Consty Posted December 20, 2010 Share Posted December 20, 2010 After opening a web page and logging in, i use the "locationurl" in the function "_IEPropertyGet". I need the current url to get the session id - but here comes the problem. My script kinda freezes and does nothing for about 5min. After that, it does what it's supposed to do. Why does it need such a long time to give me the URL? I tried a few other things from the _IEPropertyGet function - does the same thing. Help please Link to comment Share on other sites More sharing options...
MrMitchell Posted December 20, 2010 Share Posted December 20, 2010 Do you have some code? Link to comment Share on other sites More sharing options...
Consty Posted December 20, 2010 Author Share Posted December 20, 2010 the lower part - where it doesent work While 1 call("Login") _IELoadWait ($object_ctrl) $sText = _IEPropertyGet ($object_ctrl, "locationurl") $array909 = StringSplit($sText, "&session=") _ArrayDisplay($array909, "AllStrings") $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Link to comment Share on other sites More sharing options...
MrMitchell Posted December 20, 2010 Share Posted December 20, 2010 I bet it's that _IELoadWait(), it's not taking forever to get your URL it's taking forever to finish loading the page before moving on to the next line of code. Trying changing _IELoadWaitTimeout to like 1second and see if there's any difference...though your address might not be what you were expecting! I have the same problem in a script I use, but instead of using IELoadWait I am using _IENavigate (which has the wait built-in) and I get the same lag... The only other thing I can suggest is look for some other indication that your session ID is ready to pull from the address bar instead of using IELoadWait...like maybe monitor the status bar for a particular line of text? Link to comment Share on other sites More sharing options...
Consty Posted December 20, 2010 Author Share Posted December 20, 2010 Nope, nothing helps. I could get the session id from the links on the page and string management, but everything i try works so slow. I tried with "_IELinkGetCollection" - same thing. Script does nothing for about 5 min. I don't get it... Does the page code matter? Link to comment Share on other sites More sharing options...
Juvigy Posted December 21, 2010 Share Posted December 21, 2010 Did you remove IELoadWait and change it to sleep(5000) for example? Also check if you have IENavigate - it calls IELOADWAIT. Remove that for test purposes too. I second MrMitchell - it should be IELoadWait. Link to comment Share on other sites More sharing options...
Consty Posted December 21, 2010 Author Share Posted December 21, 2010 (edited) I noticed, that script actualy doesen't do nothing for about 5 min - after logging on the site. No function works. After that time, the response is normal. I tried a few simple things (msgbox) after the login - nothing! At the start page everything works - after login it freezes. I put a 5min sleep after the login, and then everything works normal. The downtime troubles me, cause i don't know what is happening... I guess it must be something wierd with the site that does it. Edited December 21, 2010 by Consty Link to comment Share on other sites More sharing options...
DaleHohm Posted December 21, 2010 Share Posted December 21, 2010 _IELoadWait times out after 5 minutes. Think that could be related? Obviously not... you haven't acknowledged anyone else that has suggested this as the source of your issue, so you must know better than we do. Good luck, I think you're on your own. 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...
Consty Posted December 21, 2010 Author Share Posted December 21, 2010 I said that nothing works... i removed the _IELoadWait and it does the same. After the login function, i put a simple msgbox which should appear after the login - but it does not. Link to comment Share on other sites More sharing options...
MrMitchell Posted December 21, 2010 Share Posted December 21, 2010 Can you post the login function? Link to comment Share on other sites More sharing options...
Consty Posted December 21, 2010 Author Share Posted December 21, 2010 here u go, nothing special in here Func Login() $oklik = _IEGetObjById ($object_ctrl, "loginBtn") ;login button _IEAction ($oklik, "click") $oLogin = _IEFormGetCollection ($object_ctrl, 0) global $oQueryLogin = _IEFormElementGetObjByName ($oLogin, "uni_url") ;uni sellection _IEFormElementOptionselect ($oQueryLogin, 5, 1, "byIndex") $var = IniRead("info.ini", "info", "ime", "NotFound") ;name read $var2 = IniRead("info.ini", "info", "pass", "NotFound") ;pass read $oForm = _IEFormGetObjByName ($object_ctrl, "loginForm") $oQuery1 = _IEFormElementGetObjByName ($oForm, "login") _IEFormElementSetValue ($oQuery1, $var) ;set name Sleep(100) $oQuery1 = _IEFormElementGetObjByName ($oForm, "pass") _IEFormElementSetValue ($oQuery1, $var2) ;set pass Sleep(100) _IEFormSubmit ($oForm) EndFunc Link to comment Share on other sites More sharing options...
Steveiwonder Posted December 21, 2010 Share Posted December 21, 2010 (edited) Add some ConsoleWrite's around your code, atleast its what i do to debug. Like this While 1 ConsoleWrite("Calling Login") Call("Login") ConsoleWrite("Loging Called") ConsoleWrite("IE Load Wait starting" & @CRLF) _IELoadWait($object_ctrl) ConsoleWrite("IE Load Wait done" & @CRLF) ConsoleWrite("Doing _IEPropertyGet()" & @CRLF) $sText = _IEPropertyGet($object_ctrl, "locationurl") ConsoleWrite("IEPropertyGet() Done" & @CRLF) ConsoleWrite("SPlitting" & @CRLF) $array909 = StringSplit($sText, "&session=") ConsoleWrite("Done splitting" & @CRLF) ; no need to comment this as the display speaks for its self. _ArrayDisplay($array909, "AllStrings") $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd if your 100% its IEPropertyGet Then do the same in ie.au3 and you can narrow it down. IEPropGet is not a very big func considering that its one big select statement you can narrow down the cause pretty easily and very fast. Steve Edited December 21, 2010 by Steveiwonder They call me MrRegExpMan Link to comment Share on other sites More sharing options...
MrMitchell Posted December 21, 2010 Share Posted December 21, 2010 Well... _IEFormSubmit is one of those functions with a built-in page load wait. Can you try changing it from _IEFormSubmit ($oForm) to _IEFormSubmit ($oForm, 0) and see if the same thing happens? Link to comment Share on other sites More sharing options...
Consty Posted December 21, 2010 Author Share Posted December 21, 2010 (edited) FOUND THE ERROR! After reading everything here and thinking - it hit me. I went looking for the function _IEFormSubmit - cause it is the last one in the login function. Func _IEFormSubmit(ByRef $o_object, $f_wait = 1) If Not IsObj($o_object) Then __IEErrorNotify("Error", "_IEFormSubmit", "$_IEStatus_InvalidDataType") Return SetError($_IEStatus_InvalidDataType, 1, 0) EndIf ; If Not __IEIsObjType($o_object, "form") Then __IEErrorNotify("Error", "_IEFormSubmit", "$_IEStatus_InvalidObjectType") Return SetError($_IEStatus_InvalidObjectType, 1, 0) EndIf ; Local $o_window = $o_object.document.parentWindow $o_object.submit If $f_wait Then _IELoadWait($o_window) Return SetError(@error, 0, -1) EndIf Return SetError($_IEStatus_Success, 0, -1) EndFunc ;==>_IEFormSubmit Indeed there is a _IELoadWait here I removed the _IELoadWait with a small sleep timer and it works! thank you all for the help! edit: MrMitchell - didn't see your post cause i was writing a reply here hehe, thanks! edit2: i restored the _IEFormSubmit to original and added _IEFormSubmit ($oForm, 0) - and it works!!! Edited December 21, 2010 by Consty Link to comment Share on other sites More sharing options...
DaleHohm Posted December 22, 2010 Share Posted December 22, 2010 And if you had read the remarks for the _IEFormSubmit function in the helpfile you would have know what to do and would not have been surprised by this. 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...
tito Posted March 2, 2011 Share Posted March 2, 2011 And if you had read the remarks for the _IEFormSubmit function in the helpfile you would have know what to do and would not have been surprised by this.DaleTss...I've had same problem with the _IELoadWait + _IECreate function with PC's (netbooks) using Win7 + SP1.Netbooks without SP1 didn't have any _loadwait issues.It (temporaly) fixed it by setting a short, 2000ms timout for _IEcreate, the if it fails: retry with a IEAttach, that does find the created window with _IEcreate.So solution so far is to avoid _IELoadWait, and define a custom wait function. Link to comment Share on other sites More sharing options...
DaleHohm Posted March 2, 2011 Share Posted March 2, 2011 The real issue is figuring out why your page is not completing its load. The IE Functions are doing what they were designed to do. 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