neo007 Posted January 11, 2008 Share Posted January 11, 2008 (edited) Hi all, I'm working on a script about a website. This website has many pages that are named by numbers. All pages are the same length. My script will navigate pages one by one and read the text of each. The problem is, some pages show 0 text, you have to refresh several times to fix it. In this case, there's no slider at right hand.----Normally the slider is the same length for these pages( = pagedown twice). So, I want to check every page's slider length and then decide whether to refresh. I checked the help file, found nothing. I noticed that there's a : #Include <GuiSlider.au3> _GUICtrlSlider_GetThumbLength($hWnd) But I used Au3info.exe, can not find any slider object in an IE window, so can not get "$hWnd". Any idea, please? Thanks. Edited January 11, 2008 by neo007 Link to comment Share on other sites More sharing options...
DaleHohm Posted January 11, 2008 Share Posted January 11, 2008 Perhaps _IEPropertyGet and get the height of the BODY object. Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
neo007 Posted January 11, 2008 Author Share Posted January 11, 2008 Perhaps _IEPropertyGet and get the height of the BODY object.Thanks Dale, but "BODY" is not in the property list of _IEPropertyGet Link to comment Share on other sites More sharing options...
BrettF Posted January 11, 2008 Share Posted January 11, 2008 Look at this example: $oIE = _IE_Example("form") $oForm = _IEFormGetObjByName($oIE, "ExampleForm") $oTextArea = _IEFormElementGetObjByName($oForm, "textareaExample") ; Get coordinates and dimensions of the textarea $iScreenX = _IEPropertyGet($oTextArea, "screenx") $iScreenY = _IEPropertyGet($oTextArea, "screeny") $iBrowserX = _IEPropertyGet($oTextArea, "browserx") $iBrowserY = _IEPropertyGet($oTextArea, "browserY") $iWidth = _IEPropertyGet($oTextArea, "width") $iHeight = _IEPropertyGet($oTextArea, "height") ; Outline the textarea with the mouse, come to rest in the center MouseMove($iScreenX, $iScreenY) MouseMove($iScreenX + $iWidth, $iScreenY) MouseMove($iScreenX + $iWidth, $iScreenY + $iHeight) MouseMove($iScreenX, $iScreenY + $iHeight) MouseMove($iScreenX, $iScreenY) MouseMove($iScreenX + $iWidth/2, $iScreenY + $iHeight/2) Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted January 11, 2008 Moderators Share Posted January 11, 2008 #include <IE.au3> $oIE = _IE_Example("form") $oBody = _IETagNameGetCollection($oIE, "BODY", 0) ConsoleWrite($oBody.scrollHeight & @CR) Link to comment Share on other sites More sharing options...
DaleHohm Posted January 11, 2008 Share Posted January 11, 2008 And you'll see that the _IEPropertyGet value returns the same answer as big_daddy's solution: #include <IE.au3> $oIE = _IEAttach("autoit") $oBody = _IETagNameGetCollection($oIE, "BODY", 0) ConsoleWrite("scrollHeight: " & $oBody.scrollHeight & @CR) ConsoleWrite("Body Height: " & _IEPropertyGet($oBody, "height") & @CR) Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted January 11, 2008 Moderators Share Posted January 11, 2008 And you'll see that the _IEPropertyGet value returns the same answer as big_daddy's solution: DaleAre you sure? #include <IE.au3> $oIE = _IE_Example("form") $hWnd = _IEPropertyGet($oIE, "hwnd") $oBody = _IETagNameGetCollection($oIE, "BODY", 0) ConsoleWrite("scrollHeight: " & $oBody.scrollHeight & @CR) ConsoleWrite("Body Height: " & _IEPropertyGet($oBody, "height") & @CR) WinSetState($hWnd, "", @SW_MAXIMIZE) ConsoleWrite("scrollHeight: " & $oBody.scrollHeight & @CR) ConsoleWrite("Body Height: " & _IEPropertyGet($oBody, "height") & @CR) Link to comment Share on other sites More sharing options...
neo007 Posted January 11, 2008 Author Share Posted January 11, 2008 (edited) And you'll see that the _IEPropertyGet value returns the same answer as big_daddy's solution: #include <IE.au3> $oIE = _IEAttach("autoit") $oBody = _IETagNameGetCollection($oIE, "BODY", 0) ConsoleWrite("scrollHeight: " & $oBody.scrollHeight & @CR) ConsoleWrite("Body Height: " & _IEPropertyGet($oBody, "height") & @CR) DaleYou two have made this point more clear for me. I tried your code, (I didn't use "autoit"), the result: scrollHeight: 695 Body Height: 886 In this set of pages, only the last one is short, and if there's net problem, the content of a page seems to be zero, I have to refresh......otherwise all pages seem to be the same length. With more test I find out that different pages have the same body height(886), even if it's the last page. But scrollheight of the last page is short. Edited January 11, 2008 by neo007 Link to comment Share on other sites More sharing options...
DaleHohm Posted January 11, 2008 Share Posted January 11, 2008 Are you sure?Can't argue with that! How curious... my example attaching to the AutoIt forum webpage did in fact return identical values.There are a whole bunch of these measurement properties and they are all over the board between different browsers and versions.I like big_daddy's suggestion the best.Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now