Discovery164 Posted November 4, 2011 Share Posted November 4, 2011 Hey all, I am getting an error from IEBodyReadText in IE.au3 and I can't reproduce it on demand. The code I wrote is simply reacting to user input on a Google form. The return is SetError($_IEStatus_Success, 0, $o_object.document.body.innertext)This code can run for hours or 5 minutes. Could I be failing grab and pass the object because of timing in a looop? Any help is greatly appreciated. While $sOnMainPage = 1 $o_IE_MainPage = _IEAttach("PNHS Learning Commons Attendance", "WindowTitle") ;MsgBox(0, "Wait", $Wait) If $o_IE_MainPage <> 0 Then $sText = _IEBodyReadText($o_IE_MainPage) ;MsgBox(0, "$sText Looks like", $sText) $sMissRequirment = StringInStr($sText, "Looks like you have a question or two that still needs to be filled out.") ;MsgBox(0, "$sMissRequirment", $sMissRequirment) If $sMissRequirment = 306 Then _IENavigate($o_IE_MainPage, "https://spreadsheets.google.com/viewform?formkey=dDFOR0NmcE", 1) MsgBox(48, "Incomplete", "Missed a required field", 3) $o_IE_MainPage = _IEAttach("PNHS Learning Commons Attendance", "WindowTitle") EndIf EndIf $o_IE_MainPage = _IEAttach("PNHS Learning Commons Attendance", "WindowTitle") ;MsgBox(0,"Secon While MSGBOX",$o_IE_MainPage) If $o_IE_MainPage = 0 Then ;MsgBox(0,"Main Page", $o_IE_MainPage) Sleep(1000) $o_IE_UnknownPage = _IEAttach("", "Instance", 1) ;MsgBox(0,"In While Loop", "ElseIf") ;Need to make sure student hasn't clicked on Google Doc's, Report Abuse, Terms of Service or Additional Terms ;or that they have completed the form Call("DeniedLink", $o_IE_UnknownPage) EndIf $o_IE_MainPage = _IEAttach("PNHS Learning Commons Attendance", "WindowTitle")WEnd Link to comment Share on other sites More sharing options...
Bert Posted November 4, 2011 Share Posted November 4, 2011 You may want to look at FormAssembly. It will do forms like this and is easier to use. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
DaleHohm Posted November 5, 2011 Share Posted November 5, 2011 Try adding _IELoadWait($oIE) just before the failing call. 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...
Discovery164 Posted November 7, 2011 Author Share Posted November 7, 2011 I will give it a shot. 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