Jump to content

Recommended Posts

Posted

How to get the position of the scrollbar in the page

Hello,every one.

I use _IECreate" to create an Internet Explorer Browser Window,and I send a few "{PGDN}" to the control.

Now my question is how can I know that the scrollbar has reached the bottom of the page?

Can you give me some advice?

Thank you!

Posted

Look into helpfile at this, there is nice example

#Include <GuiScrollBars.au3>

_GUIScrollBars_GetScrollPos($hWnd, $nBar)

But I'm not sure if it will work also with IE

Thanks.But it seems not working.
Posted (edited)

zhaicheng,

I don't know if the IE object has a method for getting to the bottom of the page or not. If it does then you should use that method. However, a workaround could be to write the source from the page to a temp file and process the source, kludgy, but works.

See help files for "inetget" and "_inetgetsource".

kylomas

Edit: assumption - this is assuming that you are looking for something specific in the page, if not just wait on "ieloadwait"

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Posted

Now my question is how can I know that the scrollbar has reached the bottom of the page?

If you only need to scroll down to the bottom of the page, there is a hotkey for that - just send "{END}" key to the IE window.

#include <IE.au3>

$oIE = _IECreate("http://www.autoitscript.com/forum/topic/124829-how-to-get-the-position-of-the-scrollbar-in-the-page/")

$hwnd = _IEPropertyGet($oIE, "hwnd")

ControlSend($hwnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{END}")
Posted

visit:http://autoit.net.cn/viewthread.php?tid=16273&from=favorites

#include <IE.au3>

$oIE = _IE_Example ("form")

$oSubmit = _IEGetObjByName ($oIE, 'textExample' )

MsgBox(0,'相对位置','左'&$oSubmit.getBoundingClientRect().left&'|上'&$oSubmit.getBoundingClientRect().top&'|宽'&$oSubmit.offsetWidth&'|高'&$oSubmit.offsetHeight)

$o_doc = _IEDocGetObj($oIE)

MsgBox(1,1,$o_doc.DocumentElement.clientHeight )

MsgBox(1,1,$o_doc.DocumentElement.ScrollHeight )

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...