faustf Posted November 28, 2016 Share Posted November 28, 2016 hi guys i have problem with a site i try to switch 3 combobox, the script work but the focussed a combobox happens after 15 min of clock how is possible that ??? #include <IE.au3> #include <MsgBoxConstants.au3> Local $oIE = _IECreate("http://fakenamegenerator.com/" , 0, 1, 1, 1) _IELoadWait($oIE) Local $oForm2 = _IEFormGetCollection($oIE, 0) ;MsgBox($MB_SYSTEMMODAL, "Forms Info", "There are " & @extended & " form(s) on this page") For $oForm In $oForm2 ConsoleWrite( $oForm.name & @CRLF) $name=String( $oForm.name()) If $name = "n" Then _IEAction($oForm, "Focus") EndIf Next i tryed also remove _ieloadwait($oie), but nothing Link to comment Share on other sites More sharing options...
Danyfirex Posted November 28, 2016 Share Posted November 28, 2016 You can do something like this. #include <IE.au3> #include <MsgBoxConstants.au3> _IEErrorHandlerRegister() Local $oIE = _IECreate("http://fakenamegenerator.com/" , 0, 1, 0, 1) Local $oButton=0 ;Wait Till Button Generate is valid While Sleep(30) $oButton=_IEGetObjById($oIE,"genbtn") ;you can wait for another element if is needed If IsObj($oButton) Then ExitLoop WEnd Local $oForm = _IEFormGetCollection($oIE, 0) Local $oSelect1 = _IEFormElementGetObjByName($oForm, "gen") Local $oSelect2 = _IEFormElementGetObjByName($oForm, "n") Local $oSelect3 = _IEFormElementGetObjByName($oForm, "c") _IEFormElementOptionSelect($oSelect1, "male", 1, "byValue") _IEFormElementOptionSelect($oSelect2, "ninja", 1, "byValue") _IEFormElementOptionSelect($oSelect3, "sp", 1, "byValue") Saludos faustf 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
faustf Posted November 28, 2016 Author Share Posted November 28, 2016 thankz work great but why my old script is to slow?? Link to comment Share on other sites More sharing options...
Danyfirex Posted November 28, 2016 Share Posted November 28, 2016 I really did not check deeply. Some month ago I got that similar issue but just handled it using the way I posted above. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
faustf Posted November 28, 2016 Author Share Posted November 28, 2016 ha thankz again Link to comment Share on other sites More sharing options...
faustf Posted November 28, 2016 Author Share Posted November 28, 2016 sorry other little bit questions , you wait a button , because you know before of the button exist/or not the checkbox??? i understund good?? thankz Local $oButton=0 ;Wait Till Button Generate is valid While Sleep(30) $oButton=_IEGetObjById($oIE,"genbtn") ;you can wait for another element if is needed If IsObj($oButton) Then ExitLoop WEnd Link to comment Share on other sites More sharing options...
Danyfirex Posted November 28, 2016 Share Posted November 28, 2016 I just wait for button beucase you I thought that you will press it then for generate the fakename (it submit the form for generating the names). But you can wait other controls you want/need. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
faustf Posted November 28, 2016 Author Share Posted November 28, 2016 (edited) Eureka i find the problem , i think is "Bug" of _IECreate when you set the script in this mode Local $oIE = _IECreate("http://fakenamegenerator.com/" , 0, 1, 1, 1) active option loadpage , and stay in loading much time , i don't know why , because the page is just arrive at end loading and we continue to wait , but if you use this Local $oIE = _IECreate("http://fakenamegenerator.com/" , 0, 1, 0, 1) work perfectly, if some one , can expleain much better if is bug or simply my bad programmation , is welcome thankz at all again and also i have thesame slow "Error" also if use this code _IEErrorHandlerRegister() Local $oIE = _IECreate("http://fakenamegenerator.com/" , 0, 1, 0, 1) _IELoadWait($oIE) Edited November 28, 2016 by faustf Link to comment Share on other sites More sharing options...
BrewManNH Posted November 28, 2016 Share Posted November 28, 2016 It's probably due to _IELoadWait, it's not always the best method to use with IE to determine if a page has finished loading. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
faustf Posted November 28, 2016 Author Share Posted November 28, 2016 agree , but how is best metod for you ?? Link to comment Share on other sites More sharing options...
Danyfirex Posted November 28, 2016 Share Posted November 28, 2016 No. It is not a bug. It more something internally in the website. Beucase some time ago when I check It was not loading. now it load faster using this flags _IECreate("http://fakenamegenerator.com/", 0, 1, 1, 1) as @BrewManNH says. sometimes _IELoadWait is not the best way to handle that. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
BrewManNH Posted November 28, 2016 Share Posted November 28, 2016 The best method would be to look for an element on the page to see if it exists yet or not, other than that, you're going to be going in blindfolded. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Danyfirex Posted November 28, 2016 Share Posted November 28, 2016 (edited) 9 minutes ago, faustf said: agree , but how is best metod for you ?? I think this question is too irrelevant. Of course a programmer will choose the documented common way, because it's the way things should be. But If you've been programming for some time(you've already) you should know that programmers fight with issues like that every day. Saludos Edited November 28, 2016 by Danyfirex typo Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
faustf Posted November 28, 2016 Author Share Posted November 28, 2016 other this not exist mode to understund if page is load ??, because if page is dinamically or after some month is changed is very frustrating 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