Danpol Posted February 20, 2019 Share Posted February 20, 2019 (edited) Hi, while i was writing script, which is using IE, i tried to use _IEBodyReadText to make sure, that website has changed. For example: While ($refreshed = 0) $website = _IEBodyReadText($oIE) $refreshed = StringInStr($website , "something i know will be when website has changed") WEnd and function sometimes returns error: Return SetError($_IESTATUS_Success, 0, $oObject.document.body.innerText) Return SetError($_IESTATUS_Success, 0, $oObject.document.body^ ERROR when I add sleep(x) works fine, but script has to be as fast as it can. Is there any way to change return from SetError to maybe some number, so i can check it in loop and prevent script from closing? _IELoadWait doesn't work as I want :/ Thanks for any advice Edited February 20, 2019 by Danpol Link to comment Share on other sites More sharing options...
Juvigy Posted February 21, 2019 Share Posted February 21, 2019 I am guessing you get error because the site hasnt finished loading. The problem is before the loop. Put IELoadWait or another thing depending on the code before the while loop. Link to comment Share on other sites More sharing options...
Danpol Posted February 21, 2019 Author Share Posted February 21, 2019 (edited) Sadly _IELoadWait before loop is not helpful :/ I'm searching that text in Frame, _IELoadWait with Frame argument returns error: --> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_InvalidDataType maybe that's problem. I get frame from that func: expandcollapse popup; #FUNCTION# ==================================================================================================================== ; Name...........: _IEFrameGetObjById ; Description ...: Returns an object reference to a Frame by ID ; Parameters ....: $o_object - Object variable of an InternetExplorer.Application, Window or Frame object ; $s_id - ID of the Frame you wish to match ; Return values .: On Success - Returns an object variable pointing to the Window object in a Frame, @EXTENDED = Frame count ; On Failure - Returns 0 and sets @ERROR ; @ERROR - 0 ($_IEStatus_Success) = No Error ; - 3 ($_IEStatus_InvalidDataType) = Invalid Data Type ; - 4 ($_IEStatus_InvalidObjectType) = Invalid Object Type ; - 7 ($_IEStatus_NoMatch) = No Match ; @Extended - Contains invalid parameter number ; Origional Author ........: Dale Hohm ; Adapted By ..............: Orrin Gradwell ; =============================================================================================================================== Func _IEFrameGetObjById(ByRef $o_object, $s_id) If Not IsObj($o_object) Then __IEErrorNotify("Error", "_IEFrameGetObjById", "$_IEStatus_InvalidDataType") Return SetError($_IEStatus_InvalidDataType, 1, 0) EndIf ; Local $oTemp, $oFrames If Not __IEIsObjType($o_object, "browserdom") Then __IEErrorNotify("Error", "_IEFrameGetObjById", "$_IEStatus_InvalidObjectType") Return SetError($_IEStatus_InvalidObjectType, 1, 0) EndIf If __IEIsObjType($o_object, "document") Then $oTemp = $o_object.parentWindow Else $oTemp = $o_object.document.parentWindow EndIf If _IEIsFrameSet($oTemp) Then $oFrames = _IETagNameGetCollection($oTemp, "frame") Else $oFrames = _IETagNameGetCollection($oTemp, "iframe") EndIf If $oFrames.length Then For $oFrame In $oFrames If $oFrame.id = $s_id Then Return SetError($_IEStatus_Success, 0, $oTemp.frames($s_id)) Next __IEErrorNotify("Warning", "_IEFrameGetObjById", "$_IEStatus_NoMatch", "No frames matching Id") Return SetError($_IEStatus_NoMatch, 2, 0) Else __IEErrorNotify("Warning", "_IEFrameGetObjById", "$_IEStatus_NoMatch", "No Frames found") Return SetError($_IEStatus_NoMatch, 2, 0) EndIf EndFunc ;==>_IEFrameGetObjById Edited February 21, 2019 by Danpol Link to comment Share on other sites More sharing options...
Nine Posted February 21, 2019 Share Posted February 21, 2019 Could you post a runable script so we don't have to guess what is the problem ? “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Danpol Posted February 21, 2019 Author Share Posted February 21, 2019 The problem is that site is corporate :/ 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