Champak Posted August 3, 2023 Posted August 3, 2023 (edited) It will be easier for me to show a mockup of what I'm trying to achieve instead of trying to explain it. At the end of this, is there a way to check the status of a page loading/complete of a specific tab? expandcollapse popup#include "wd_helper.au3" #include "wd_capabilities.au3" Global $sDesiredCapabilities = SetupChrome(0) _WD_Startup() If @error <> $_WD_ERROR_Success Then MsgBox(0,"Error with chrome startup.",@error) $sSession = _WD_CreateSession($sDesiredCapabilities) ;Setup an array of urls $ArrayOfWebsites[10] = "" ;Set up the tabs and navigate to the initial urls $a = _WD_NewTab($sSession, Default, 0, $ArrayOfWebsites[0]);---I know this doesn't return information that I can use in this way $Tab1 = $ArrayOfWebsites[0] $b = _WD_NewTab($sSession, Default, 0, $ArrayOfWebsites[1]) $Tab2 = $ArrayOfWebsites[1] $c = _WD_NewTab($sSession, Default, 0, $ArrayOfWebsites[2]) $Tab3 = $ArrayOfWebsites[2] $i = 3 $x = 0 Do ;Check if the url finished doing its thing and completed loading If _WD_FinishedLoading($a) = 1 Then;---This is just a made up function, hoping something in the UDF can accomplish this. ;Attatch to this tab if it did _WD_Attach($sSession, $Tab1, "URL") ;Navigate to the next URL in the array $a = _WD_Navigate($a, Default, 0, $ArrayOfWebsites[$i]) ;Set the URL in a variable for when the loop comes back around we know what url is in this tab $Tab1 = $ArrayOfWebsites[$i] ;Incriment to the next index of the array for whichever tab finishes up next to pick up where we left off $i += 1 EndIf If _WD_FinishedLoading($b) = 1 _WD_Attach($sSession, $Tab2, "URL") $b = _WD_Navigate($b, Default, 0, $ArrayOfWebsites[$i]) $Tab2 = $ArrayOfWebsites[$i] $i += 1 EndIf If _WD_FinishedLoading($c) = 1 _WD_Attach($sSession, $Tab3, "URL") $c = _WD_Navigate($c, Default, 0, $ArrayOfWebsites[$i]) $Tab3 = $ArrayOfWebsites[$i] $i += 1 EndIf $x += 1 Sleep(10000) Until $i = UBound($ArrayOfWebsites) _WD_DeleteSession($sSession) _WD_Shutdown() Func SetupChrome($Headless = 1, $Mobile = 0) _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'chrome') _WD_CapabilitiesAdd('w3c', True) _WD_CapabilitiesAdd('args', "user-data-dir=C:\\Users\\" & @UserName & "\\AppData\\Local\\Google\\Chrome\\User Data\\Profile 1") If $Headless = 1 Then _WD_CapabilitiesAdd('args', '--headless') If $Mobile = 1 Then _WD_CapabilitiesAdd("mobileEmulation", "deviceName", 'Galaxy S9+') _WD_CapabilitiesAdd('excludeSwitches', 'enable-automation') _WD_CapabilitiesAdd('pageLoadStrategy', 'none') _WD_CapabilitiesDump(@ScriptLineNumber) ; dump current Capabilities setting to console - only for testing in this demo Local $sDesiredCapabilities = _WD_CapabilitiesGet() Return $sDesiredCapabilities EndFunc ;==>SetupChrome Also, everything in the helpfile comes up blank. Edited August 3, 2023 by Champak
Danp2 Posted August 3, 2023 Posted August 3, 2023 1 hour ago, Champak said: ;---I know this doesn't return information that I can use in this way Actually, you can do something like this -- $sTabHandle = _WD_NewTab($sSession, Default, Default, $ArrayOfWebsites[0]) _WD_Window($sSession, 'Switch', $sTabHandle) ; _WD_Attach uses a form of this internally Quote At the end of this, is there a way to check the status of a page loading/complete of a specific tab? Yes... with _WD_LoadWait. However, you need to switch to the target tab before you can check its load status. _WD_Window($sSession, 'Switch', $sTabHandle) ; Option 1 If _WD_LoadWait($sSession) Then ; Perform your additional actions here EndIf ; Option 2 _WD_LoadWait($sSession) If @error = $_WD_ERROR_Success Then ; Perform your additional actions here EndIf You could use a single array to hold the target URLs, their tab handles, and a flag to control whether the tab should be processed or skipped. Latest Webdriver UDF Release Webdriver Wiki FAQs
mLipok Posted August 3, 2023 Posted August 3, 2023 @Champak I understood that yours main intention is like this: Quote At start: Create a TAB Navigate to the page - but don't even check if anything has already loaded, i.e. no response from the browser Repeat the previous steps as many times as you need to have pre-opened pages in separate tabs Now just follow the next steps: Go to the desired tab Check out the content - starting with _WD_Navigate Save the results Initialize next search on the same page - but don't wait for the results Follow the steps above for each next tab Follow the steps above for subsequent inputs (source data) @Champak please confirm that my reasoning fits your needs or not ? @Danp2 Is your understanding of the questioner's intention the same as mine? 8 minutes ago, Danp2 said: 56 minutes ago, mLipok said: Is your understanding of the questioner's intention the same as mine? I think so btw.I have exact such solution made for my clients, to extract data from several websites in one browser in many tabs at once.So I already have some experience with it.But so far I've always waited for a given website content to be fully loaded in a given tab. Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24
Champak Posted August 3, 2023 Author Posted August 3, 2023 Thanks, so far it works but has a random fault I can't figure out how to fix....I'll get back to that. 14 hours ago, Danp2 said: You could use a single array to hold the target URLs, their tab handles, and a flag to control whether the tab should be processed or skipped. I'm trying to visualize this, but I don't know exactly what you mean by this or see the benefit, enlighten me. 2 hours ago, mLipok said: @Champak please confirm that my reasoning fits your needs or not ? Close but not completely as you can see in my working example below. So back to my still standing issue. 7 out of 10 it works fine. Then those 3 times it seems the script stops working. expandcollapse popup#include "wd_helper.au3" #include "wd_capabilities.au3" Global $sDesiredCapabilities = SetupChrome(0) _WD_Startup() If @error <> $_WD_ERROR_Success Then MsgBox(0,"Error with chrome startup.",@error) $sSession = _WD_CreateSession($sDesiredCapabilities) ;Setup an array of urls Global $ArrayOfWebsites[9] = ["https://secure1.inmotionhosting.com/index/login", _ "https://cnn.com", "https://amazon.com", _ "https://www.wordstream.com/ppc", _ "https://msn.com", _ "https://www.opencart.com", _ "https://thefreedictionary.com/", _ "https://www.lohud.com/"] ;Set up the tabs and navigate to the initial urls $a = _WD_NewTab($sSession, Default, 0, $ArrayOfWebsites[0]) $Tab1 = $ArrayOfWebsites[0] $b = _WD_NewTab($sSession, Default, 0, $ArrayOfWebsites[1]) $Tab2 = $ArrayOfWebsites[1] $c = _WD_NewTab($sSession, Default, 0, $ArrayOfWebsites[2]) $Tab3 = $ArrayOfWebsites[2] $i = 3 $x = 0 $ArrayMax = UBound($ArrayOfWebsites) - 1 Sleep(2000) Do ;Check if the url finished doing its thing and completed loading _WD_Window($sSession, 'Switch', $a) ConsoleWrite("-- Trying First Tab with URL index " & $i & @CRLF) If _WD_LoadWait($sSession, 0, 0) And $i < $ArrayMax Then ConsoleWrite(@CRLF & "!================================================================= " & $ArrayOfWebsites[$i] & @CRLF & @CRLF) ;Attatch to this tab if it did _WD_Attach($sSession, $Tab1, "URL") ;Navigate to the next URL in the array _WD_Navigate($sSession, $ArrayOfWebsites[$i]) ;Set the URL in a variable for when the loop comes back around we know what url is in this tab $Tab1 = $ArrayOfWebsites[$i] ;Incriment to the next index of the array for whichever tab finishes up next to pick up where we left off $i += 1 EndIf _WD_Window($sSession, 'Switch', $b) ConsoleWrite("-- Trying Second Tab with URL index " & $i & @CRLF) If _WD_LoadWait($sSession, 0, 0) And $i < $ArrayMax Then ConsoleWrite(@CRLF & "!================================================================= " & $ArrayOfWebsites[$i] & @CRLF & @CRLF) _WD_Attach($sSession, $Tab2, "URL") _WD_Navigate($sSession, $ArrayOfWebsites[$i]) $Tab2 = $ArrayOfWebsites[$i] $i += 1 EndIf _WD_Window($sSession, 'Switch', $c) ConsoleWrite("-- Trying Third Tab with URL index " & $i & @CRLF) If _WD_LoadWait($sSession, 0, 0) And $i < $ArrayMax Then ConsoleWrite(@CRLF & "!================================================================== " & $ArrayOfWebsites[$i] & @CRLF & @CRLF) _WD_Attach($sSession, $Tab3, "URL") _WD_Navigate($sSession, $ArrayOfWebsites[$i]) $Tab3 = $ArrayOfWebsites[$i] $i += 1 EndIf $x += 1 ConsoleWrite("+ Loop " & $x & @CRLF & @CRLF) Sleep(5000) Until $i = $ArrayMax ConsoleWrite(">>> EXIT Loop " & $x & @CRLF & @CRLF) ;Sleep(20000) _WD_LoadWait($sSession, 20000, 5000);Give the last page time to fully load before shutting down _WD_DeleteSession($sSession) _WD_Shutdown() Func SetupChrome($Headless = 1, $Mobile = 0) _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'chrome') _WD_CapabilitiesAdd('w3c', True) _WD_CapabilitiesAdd('args', "user-data-dir=C:\\Users\\" & @UserName & "\\AppData\\Local\\Google\\Chrome\\User Data\\Profile 1") If $Headless = 1 Then _WD_CapabilitiesAdd('args', '--headless') If $Mobile = 1 Then _WD_CapabilitiesAdd("mobileEmulation", "deviceName", 'Galaxy S9+') _WD_CapabilitiesAdd('excludeSwitches', 'enable-automation') _WD_CapabilitiesAdd('pageLoadStrategy', 'none') _WD_CapabilitiesDump(@ScriptLineNumber) ; dump current Capabilities setting to console - only for testing in this demo Local $sDesiredCapabilities = _WD_CapabilitiesGet() Return $sDesiredCapabilities EndFunc ;==>SetupChrome Here's the console printout. It fails trying to find "thefreedictionary.com"(in this example, not all the time) and never actually navigates to it. Then it goes on and doesn't find anything else. It also starts to take longer as if there is now a loadwait time. Loop 4 and loop 5 took about 6 minutes each. I have no idea how to go about fixing this issue. expandcollapse popup>Running:(3.3.16.0):C:\Additions\AutoIt3\autoit3.exe "C:\Users\Sink Or Swim\Documents\Website\Inventory\test_navigation_loop.au3" +>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+BREAK to Stop. _WD_Option ==> Success [0] : Parameters: Option=Driver Value=chromedriver.exe _WD_Option ==> Success [0] : Parameters: Option=Port Value=9515 _WD_Option ==> Success [0] : Parameters: Option=DriverParams Value=--verbose --log-path="C:\Users\Sink Or Swim\Documents\Website\Inventory\chrome.log" _WD_CapabilitiesAdd ==> Success [0] : Successfully used [alwaysMatch] with specified browser: chrome _WD_CapabilitiesAdd ==> Success [0] : Successfully added capability _WD_CapabilitiesAdd ==> Success [0] : Successfully added capability _WD_CapabilitiesAdd ==> Success [0] : Successfully added capability _WD_CapabilitiesAdd ==> Success [0] : Successfully added capability _WD_CapabilitiesDump: JSON structure starts below: 120 { "capabilities":{ "alwaysMatch":{ "goog:chromeOptions":{ "w3c":true, "args":[ "user-data-dir=C:\\\\Users\\\\Sink Or Swim\\\\AppData\\\\Local\\\\Google\\\\Chrome\\\\User Data\\\\Profile 1" ], "excludeSwitches":[ "enable-automation" ] }, "pageLoadStrategy":"none" } } } _WD_CapabilitiesDump: JSON structure ends above. _WD_GetFreePort ==> Success [0 / 9515] : Parameters: MinPort=9515 MaxPort=Default _WD_IsLatestRelease ==> Success [0] : False _WD_Startup: OS: WIN_10 X64 19044 _WD_Startup: AutoIt: 3.3.16.0 _WD_Startup: Webdriver UDF: 1.1.0 (Update available) _WD_Startup: WinHTTP: 1.6.4.1 (Download latest source at <https://raw.githubusercontent.com/dragana-r/autoit-winhttp/master/WinHttp.au3>) _WD_Startup: Driver: chromedriver.exe (32 Bit) _WD_Startup: Params: --verbose --log-path="C:\Users\Sink Or Swim\Documents\Website\Inventory\chrome.log" _WD_Startup: Port: 9515 _WD_Startup: Command: "chromedriver.exe" --verbose --log-path="C:\Users\Sink Or Swim\Documents\Website\Inventory\chrome.log" _WD_Startup ==> Success [0] __WD_Post ==> Success [0] : HTTP status = 200 _WD_CreateSession ==> Success [0] : 88e8334872880bab64509e18a68256d8 __WD_Get ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=window Option=Default __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=new Option={"type":"tab"} __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option={"handle":"12B7DA6610B8D724357C0B90D560FD66"} __WD_Post ==> Success [0] : HTTP status = 200 _WD_Navigate ==> Success [0] : Parameters: URL=https://secure1.inmotionhosting.com/index/login _WD_NewTab ==> Success [0] : Parameters: Switch=Default Timeout=0 URL=https://secure1.inmotionhosting.com/index/login Features=Default __WD_Get ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=window Option=Default __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=new Option={"type":"tab"} __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option={"handle":"B3CD39AF166EAA16D822021F49636B7B"} __WD_Post ==> Success [0] : HTTP status = 200 _WD_Navigate ==> Success [0] : Parameters: URL=https://cnn.com _WD_NewTab ==> Success [0] : Parameters: Switch=Default Timeout=0 URL=https://cnn.com Features=Default __WD_Get ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=window Option=Default __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=new Option={"type":"tab"} __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option={"handle":"F1282DC6997A2DBE5041832FE3F01A4D"} __WD_Post ==> Success [0] : HTTP status = 200 _WD_Navigate ==> Success [0] : Parameters: URL=https://amazon.com _WD_NewTab ==> Success [0] : Parameters: Switch=Default Timeout=0 URL=https://amazon.com Features=Default __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option=12B7DA6610B8D724357C0B90D560FD66 -- Trying First Tab with URL index 3 _WD_LoadWait ==> Timeout [7 / 1] : Parameters: Delay=0 Timeout=0 Element=Default DesiredState=complete : ReadyState= loading (Is loading) __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option=B3CD39AF166EAA16D822021F49636B7B -- Trying Second Tab with URL index 3 _WD_LoadWait ==> Timeout [7 / 1] : Parameters: Delay=0 Timeout=0 Element=Default DesiredState=complete : ReadyState= loading (Is loading) __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option=F1282DC6997A2DBE5041832FE3F01A4D -- Trying Third Tab with URL index 3 _WD_LoadWait ==> Timeout [7 / 1] : Parameters: Delay=0 Timeout=0 Element=Default DesiredState=complete : ReadyState= loading (Is loading) + Loop 1 __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option=12B7DA6610B8D724357C0B90D560FD66 -- Trying First Tab with URL index 3 _WD_LoadWait ==> Success [0 / 4] : Parameters: Delay=0 Timeout=0 Element=Default DesiredState=complete : ReadyState= complete (Fully loaded) !================================================================= https://www.wordstream.com/ppc __WD_Get ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=handles Option=Default __WD_Get ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=window Option=Default __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option={"handle":"076B5ED9BAC2B289CF85B522D5BA11D4"} __WD_Get ==> Success [0] : HTTP status = 200 _WD_Action ==> Success [0] : Parameters: Command=URL Option=Default __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option={"handle":"12B7DA6610B8D724357C0B90D560FD66"} __WD_Get ==> Success [0] : HTTP status = 200 _WD_Action ==> Success [0] : Parameters: Command=URL Option=Default _WD_Attach ==> Success [0] : Parameters: Search=https://secure1.inmotionhosting.com/index/login Mode=URL __WD_Post ==> Success [0] : HTTP status = 200 _WD_Navigate ==> Success [0] : Parameters: URL=https://www.wordstream.com/ppc __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option=B3CD39AF166EAA16D822021F49636B7B -- Trying Second Tab with URL index 4 _WD_LoadWait ==> Timeout [7 / 3] : Parameters: Delay=0 Timeout=0 Element=Default DesiredState=complete : ReadyState= interactive (Has loaded enough to interact with) __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option=F1282DC6997A2DBE5041832FE3F01A4D -- Trying Third Tab with URL index 4 _WD_LoadWait ==> Success [0 / 4] : Parameters: Delay=0 Timeout=0 Element=Default DesiredState=complete : ReadyState= complete (Fully loaded) !================================================================== https://msn.com __WD_Get ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=handles Option=Default __WD_Get ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=window Option=Default __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option={"handle":"076B5ED9BAC2B289CF85B522D5BA11D4"} __WD_Get ==> Success [0] : HTTP status = 200 _WD_Action ==> Success [0] : Parameters: Command=URL Option=Default __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option={"handle":"12B7DA6610B8D724357C0B90D560FD66"} __WD_Get ==> Success [0] : HTTP status = 200 _WD_Action ==> Success [0] : Parameters: Command=URL Option=Default __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option={"handle":"B3CD39AF166EAA16D822021F49636B7B"} __WD_Get ==> Success [0] : HTTP status = 200 _WD_Action ==> Success [0] : Parameters: Command=URL Option=Default __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option={"handle":"F1282DC6997A2DBE5041832FE3F01A4D"} __WD_Get ==> Success [0] : HTTP status = 200 _WD_Action ==> Success [0] : Parameters: Command=URL Option=Default __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option={"handle":"F1282DC6997A2DBE5041832FE3F01A4D"} _WD_Attach ==> No match [8] : Parameters: Search=https://amazon.com Mode=URL __WD_Post ==> Success [0] : HTTP status = 200 _WD_Navigate ==> Success [0] : Parameters: URL=https://msn.com + Loop 2 __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option=12B7DA6610B8D724357C0B90D560FD66 -- Trying First Tab with URL index 5 _WD_LoadWait ==> Success [0 / 4] : Parameters: Delay=0 Timeout=0 Element=Default DesiredState=complete : ReadyState= complete (Fully loaded) !================================================================= https://www.opencart.com __WD_Get ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=handles Option=Default __WD_Get ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=window Option=Default __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option={"handle":"076B5ED9BAC2B289CF85B522D5BA11D4"} __WD_Get ==> Success [0] : HTTP status = 200 _WD_Action ==> Success [0] : Parameters: Command=URL Option=Default __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option={"handle":"12B7DA6610B8D724357C0B90D560FD66"} __WD_Get ==> Success [0] : HTTP status = 200 _WD_Action ==> Success [0] : Parameters: Command=URL Option=Default _WD_Attach ==> Success [0] : Parameters: Search=https://www.wordstream.com/ppc Mode=URL __WD_Post ==> Success [0] : HTTP status = 200 _WD_Navigate ==> Success [0] : Parameters: URL=https://www.opencart.com __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option=B3CD39AF166EAA16D822021F49636B7B -- Trying Second Tab with URL index 6 _WD_LoadWait ==> Timeout [7 / 3] : Parameters: Delay=0 Timeout=0 Element=Default DesiredState=complete : ReadyState= interactive (Has loaded enough to interact with) __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option=F1282DC6997A2DBE5041832FE3F01A4D -- Trying Third Tab with URL index 6 _WD_LoadWait ==> Success [0 / 4] : Parameters: Delay=0 Timeout=0 Element=Default DesiredState=complete : ReadyState= complete (Fully loaded) !================================================================== https://thefreedictionary.com/ __WD_Get ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=handles Option=Default __WD_Get ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=window Option=Default __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option={"handle":"076B5ED9BAC2B289CF85B522D5BA11D4"} __WD_Get ==> Success [0] : HTTP status = 200 _WD_Action ==> Success [0] : Parameters: Command=URL Option=Default __WD_Post ==> Success [0] : HTTP status = 200 _WD_Window ==> Success [0] : Parameters: Command=Switch Option={"handle":"12B7DA6610B8D724357C0B90D560FD66"} __WD_Get ==> Send / Recv error [6] : HTTP status = 0 _WD_Action ==> Send / Recv error [6] : Parameters: Command=URL Option=Default __WD_Post ==> Send / Recv error [6] : HTTP status = 0 _WD_Window ==> Send / Recv error [6] : Parameters: Command=Switch Option={"handle":"B3CD39AF166EAA16D822021F49636B7B"} __WD_Get ==> Send / Recv error [6] : HTTP status = 0 _WD_Action ==> Send / Recv error [6] : Parameters: Command=URL Option=Default __WD_Post ==> Send / Recv error [6] : HTTP status = 0 _WD_Window ==> Send / Recv error [6] : Parameters: Command=Switch Option={"handle":"F1282DC6997A2DBE5041832FE3F01A4D"} __WD_Get ==> Send / Recv error [6] : HTTP status = 0 _WD_Action ==> Send / Recv error [6] : Parameters: Command=URL Option=Default __WD_Post ==> Send / Recv error [6] : HTTP status = 0 _WD_Window ==> Send / Recv error [6] : Parameters: Command=Switch Option={"handle":"F1282DC6997A2DBE5041832FE3F01A4D"} _WD_Attach ==> No match [8] : Parameters: Search=https://msn.com Mode=URL __WD_Post ==> Send / Recv error [6] : HTTP status = 0 _WD_Navigate ==> Send / Recv error [6] : Parameters: URL=https://thefreedictionary.com/ + Loop 3 __WD_Post ==> Send / Recv error [6] : HTTP status = 0 _WD_Window ==> Send / Recv error [6] : Parameters: Command=Switch Option=12B7DA6610B8D724357C0B90D560FD66 -- Trying First Tab with URL index 7 _WD_LoadWait ==> Webdriver Exception [10 / 0] : Parameters: Delay=0 Timeout=0 Element=Default DesiredState=complete : ReadyState= __WD_Post ==> Send / Recv error [6] : HTTP status = 0 _WD_Window ==> Send / Recv error [6] : Parameters: Command=Switch Option=B3CD39AF166EAA16D822021F49636B7B -- Trying Second Tab with URL index 7 _WD_LoadWait ==> Webdriver Exception [10 / 0] : Parameters: Delay=0 Timeout=0 Element=Default DesiredState=complete : ReadyState= __WD_Post ==> Send / Recv error [6] : HTTP status = 0 _WD_Window ==> Send / Recv error [6] : Parameters: Command=Switch Option=F1282DC6997A2DBE5041832FE3F01A4D -- Trying Third Tab with URL index 7 _WD_LoadWait ==> Webdriver Exception [10 / 0] : Parameters: Delay=0 Timeout=0 Element=Default DesiredState=complete : ReadyState= + Loop 4 __WD_Post ==> Send / Recv error [6] : HTTP status = 0 _WD_Window ==> Send / Recv error [6] : Parameters: Command=Switch Option=12B7DA6610B8D724357C0B90D560FD66 -- Trying First Tab with URL index 7 _WD_LoadWait ==> Webdriver Exception [10 / 0] : Parameters: Delay=0 Timeout=0 Element=Default DesiredState=complete : ReadyState= __WD_Post ==> Send / Recv error [6] : HTTP status = 0 _WD_Window ==> Send / Recv error [6] : Parameters: Command=Switch Option=B3CD39AF166EAA16D822021F49636B7B -- Trying Second Tab with URL index 7 _WD_LoadWait ==> Webdriver Exception [10 / 0] : Parameters: Delay=0 Timeout=0 Element=Default DesiredState=complete : ReadyState= __WD_Post ==> Send / Recv error [6] : HTTP status = 0 _WD_Window ==> Send / Recv error [6] : Parameters: Command=Switch Option=F1282DC6997A2DBE5041832FE3F01A4D -- Trying Third Tab with URL index 7 _WD_LoadWait ==> Webdriver Exception [10 / 0] : Parameters: Delay=0 Timeout=0 Element=Default DesiredState=complete : ReadyState= + Loop 5 __WD_Post ==> Send / Recv error [6] : HTTP status = 0 _WD_Window ==> Send / Recv error [6] : Parameters: Command=Switch Option=12B7DA6610B8D724357C0B90D560FD66 -- Trying First Tab with URL index 7 >Process failed to respond; forcing abrupt termination... >Exit code: 1 Time: 703
Danp2 Posted August 4, 2023 Posted August 4, 2023 Check chrome.log to see if you can identify the initial error. It's like the webdriver is crashing or the session is lost. P.S. your winhttp source is outdated Latest Webdriver UDF Release Webdriver Wiki FAQs
Champak Posted August 4, 2023 Author Posted August 4, 2023 OK, I'll check the log the next time it happens....that is overwritten every start up correct? In the meantime I can probably do a workaround and exit and restart the function with adlib if I can detect that the "ready" status is empty. But I don't see how to retrieve that information, can you provide that info. Also, you didn't respond to my statement that the chm help file is blank on everything, is there something I can do about that?
Danp2 Posted August 4, 2023 Posted August 4, 2023 7 hours ago, Champak said: chm help file is blank on everything This is a fairly common problem. I would suggest checking the following -- Make sure the file is stored on a local (non-network) drive Open the file's properties and look for an Unblock option. Once you get the help working correctly, take a look at _WD_CheckContext, which may help with the disconnect issue. Latest Webdriver UDF Release Webdriver Wiki FAQs
Champak Posted August 4, 2023 Author Posted August 4, 2023 Thanks, all seems to be working pretty well. One question/issue, instead of searching for the tab by url where the process seems to go to every tab to check the url, is it possible to just switch to a tab like an index/switch, that would speed-up the process considerably.
mLipok Posted August 4, 2023 Posted August 4, 2023 (edited) hm.. _WD_Window($sSession, 'Switch', $c) ConsoleWrite("-- Trying Third Tab with URL index " & $i & @CRLF) If _WD_LoadWait($sSession, 0, 0) And $i < $ArrayMax Then ConsoleWrite(@CRLF & "!================================================================== " & $ArrayOfWebsites[$i] & @CRLF & @CRLF) _WD_Attach($sSession, $Tab3, "URL") _WD_Navigate($sSession, $ArrayOfWebsites[$i]) $Tab3 = $ArrayOfWebsites[$i] $i += 1 EndIf wondering. After you switch to tab using: _WD_Window($sSession, 'Switch', $c) why you try to attach here: _WD_Attach($sSession, $Tab3, "URL") _WD_Navigate($sSession, $ArrayOfWebsites[$i]) hm.... What is you goal, I see the logic this way: INIT: TAB_A > URL_0 TAB_B > URL_1 TAB_C > URL_2 ITERATION 1: TAB_A > URL_3 TAB_B > URL_4 TAB_C > URL_5 ITERATION 2: TAB_A > URL_6 TAB_B > URL_7 TAB_C > URL_8 Edited August 4, 2023 by mLipok Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24
mLipok Posted August 4, 2023 Posted August 4, 2023 btw. here is my modified version of your testing repro code: expandcollapse popup#include "wd_helper.au3" #include "wd_capabilities.au3" Global $sDesiredCapabilities = SetupChrome(0) _WD_UpdateDriver('Chrome') _WD_Startup() If @error <> $_WD_ERROR_Success Then MsgBox(0, "Error with chrome startup.", @error) Global $sSession = _WD_CreateSession($sDesiredCapabilities) ;Setup an array of urls Global $arrayOfWebsites[9] = [ _ "https://secure1.inmotionhosting.com/index/login", _ "https://cnn.com", "https://amazon.com", _ "https://www.wordstream.com/ppc", _ "https://msn.com", _ "https://www.opencart.com", _ "https://thefreedictionary.com/", _ "https://www.lohud.com/" _ ] Global $arrayMax = UBound($arrayOfWebsites) - 1 _Example() _WD_DeleteSession($sSession) _WD_Shutdown() Func _Example() ;Set up the tabs and navigate to the initial urls #Region - initialize tabs Local $_WD_TAB_a = _WD_NewTab($sSession, Default, 0, $arrayOfWebsites[0]) Local $_WD_TAB_b = _WD_NewTab($sSession, Default, 0, $arrayOfWebsites[1]) Local $_WD_TAB_c = _WD_NewTab($sSession, Default, 0, $arrayOfWebsites[2]) Local $i = 3 Local $x = 0 Sleep(2000) #EndRegion - initialize tabs Do _TabHelper($_WD_TAB_a, $i) _TabHelper($_WD_TAB_b, $i) _TabHelper($_WD_TAB_c, $i) $x += 1 ConsoleWrite("+ Loop " & $x & @CRLF & @CRLF) Sleep(5000) Until $i = $arrayMax ConsoleWrite(">>> EXIT Loop " & $x & @CRLF & @CRLF) ;Sleep(20000) _WD_LoadWait($sSession, 20000, 5000) ;Give the last page time to fully load before shutting down EndFunc ;==>_Example Func _TabHelper($TAB, ByRef $i) _WD_Window($sSession, 'Switch', $TAB) ConsoleWrite("-- Trying First Tab with URL index " & $i & @CRLF) If _WD_LoadWait($sSession, 0, 0) And $i < $arrayMax Then ConsoleWrite(@CRLF & "!================================================================= " & $arrayOfWebsites[$i] & @CRLF & @CRLF) ;Navigate to the next URL in the array _WD_Navigate($sSession, $arrayOfWebsites[$i]) ;Incriment to the next index of the array for whichever tab finishes up next to pick up where we left off $i += 1 EndIf EndFunc ;==>_TabHelper Func SetupChrome($Headless = 1, $Mobile = 0) _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'chrome') _WD_CapabilitiesAdd('w3c', True) _WD_CapabilitiesAdd('args', "user-data-dir=C:\\Users\\" & @UserName & "\\AppData\\Local\\Google\\Chrome\\User Data\\Profile 1") If $Headless = 1 Then _WD_CapabilitiesAdd('args', '--headless') If $Mobile = 1 Then _WD_CapabilitiesAdd("mobileEmulation", "deviceName", 'Galaxy S9+') _WD_CapabilitiesAdd('excludeSwitches', 'enable-automation') _WD_CapabilitiesAdd('pageLoadStrategy', 'none') _WD_CapabilitiesDump(@ScriptLineNumber) ; dump current Capabilities setting to console - only for testing in this demo Local $sDesiredCapabilities = _WD_CapabilitiesGet() Return $sDesiredCapabilities EndFunc ;==>SetupChrome Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24
mLipok Posted August 4, 2023 Posted August 4, 2023 (edited) I just notice: On 8/3/2023 at 8:02 PM, Champak said: Global $ArrayOfWebsites[9] = ["https://secure1.inmotionhosting.com/index/login", _ "https://cnn.com", "https://amazon.com", _ "https://www.wordstream.com/ppc", _ "https://msn.com", _ "https://www.opencart.com", _ "https://thefreedictionary.com/", _ "https://www.lohud.com/"] array of 9 elements but you put there only 8 elements. It is interestning case for me so: Check out this modified version: expandcollapse popup#include "wd_helper.au3" #include "wd_capabilities.au3" Global $sCapabilities = SetupChrome(0) _WD_UpdateDriver('Chrome') _WD_Startup() If @error <> $_WD_ERROR_Success Then MsgBox(0, "Error with chrome startup.", @error) Global $sSession = _WD_CreateSession($sCapabilities) ;Setup an array of urls Global $arrayOfWebsites = [ _ "https://secure1.inmotionhosting.com/index/login", _ "https://cnn.com", _ "https://amazon.com", _ "https://www.wordstream.com/ppc", _ "https://msn.com", _ "https://www.opencart.com", _ "https://thefreedictionary.com", _ "https://www.lohud.com" _ ] Global $arrayMax = UBound($arrayOfWebsites) - 1 Global $_WD_TAB_a, $_WD_TAB_b, $_WD_TAB_c _Example() _WD_DeleteSession($sSession) _WD_Shutdown() Func _Example() For $i = 0 To $arrayMax _TabHelper($i) Next _WD_LoadWait($sSession, 20, 50000) ;Give the last page time to fully load before shutting down MsgBox($MB_TOPMOST, "Info", "Check before end.") EndFunc ;==>_Example Func _TabHelper($i) If $i = 0 Then $_WD_TAB_a = _WD_Window($sSession, 'WINDOW') ElseIf $i = 1 Then $_WD_TAB_b = _WD_NewTab($sSession, Default, 0) ElseIf $i = 2 Then $_WD_TAB_c = _WD_NewTab($sSession, Default, 0) Else Switch Mod($i, 3) Case 0 _WD_Window($sSession, 'Switch', $_WD_TAB_a) Case 1 _WD_Window($sSession, 'Switch', $_WD_TAB_b) Case 2 _WD_Window($sSession, 'Switch', $_WD_TAB_c) EndSwitch EndIf ConsoleWrite("-- Trying Tab with URL index " & $i & @CRLF) If _WD_LoadWait($sSession, 0, 0) And $i < $arrayMax Then ConsoleWrite(@CRLF & "!================================================================= " & $arrayOfWebsites[$i] & @CRLF & @CRLF) ;Navigate to the next URL in the array _WD_Navigate($sSession, $arrayOfWebsites[$i]) EndIf EndFunc ;==>_TabHelper Func SetupChrome($Headless = 1, $Mobile = 0) _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'chrome') _WD_CapabilitiesAdd('w3c', True) _WD_CapabilitiesAdd('args', "user-data-dir=C:\\Users\\" & @UserName & "\\AppData\\Local\\Google\\Chrome\\User Data\\Profile 1") If $Headless = 1 Then _WD_CapabilitiesAdd('args', '--headless') If $Mobile = 1 Then _WD_CapabilitiesAdd("mobileEmulation", "deviceName", 'Galaxy S9+') _WD_CapabilitiesAdd('excludeSwitches', 'enable-automation') _WD_CapabilitiesAdd('pageLoadStrategy', 'none') _WD_CapabilitiesDump(@ScriptLineNumber) ; dump current Capabilities setting to console - only for testing in this demo Return _WD_CapabilitiesGet() EndFunc ;==>SetupChrome Edited August 4, 2023 by mLipok Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24
Champak Posted August 4, 2023 Author Posted August 4, 2023 (edited) I was just coming back with the following and I see your iteration. Thanks, I'll give it a look over. And yeah, I caught that array issue. expandcollapse popup#include "wd_helper.au3" #include "wd_capabilities.au3" Global $sDesiredCapabilities = SetupChrome(0) _WD_Startup() If @error <> $_WD_ERROR_Success Then MsgBox(0,"Error with chrome startup.",@error) $sSession = _WD_CreateSession($sDesiredCapabilities) ;Setup an array of urls #cs Global $ArrayOfWebsites[8] = ["https://secure1.inmotionhosting.com/index/login", _ "https://cnn.com", _ "https://amazon.com", _ "https://www.wordstream.com/ppc", _ "https://msn.com", _ "https://www.opencart.com", _ "https://thefreedictionary.com/", _ "https://www.lohud.com/"] #ce Global $ArrayOfWebsites = FileReadToArray("C:\Users\Sink Or Swim\Documents\Website\Sitemap.txt") ;_ArrayDisplay($ArrayOfWebsites) Global $Count = 4, $tabCount[9][2] For $r = 0 to $Count ;Set up the tabs and navigate to the initial urls $tabCount[$r][0] = _WD_NewTab($sSession, Default, 0, $ArrayOfWebsites[0]) $tabCount[$r][1] = $ArrayOfWebsites[0] Next $i = $Count + 1 $x = 0 $ArrayMax = UBound($ArrayOfWebsites) - 1 Sleep(2000) $rr4 = TimerInit() ;============================================================================================================== Do For $z = 0 To $Count ConsoleWrite(">>>>>>>>>>>>>>>>>>>> " & $z & @CRLF) ConsoleWrite(">>>>>>>>>>>>>>>>>>>> " & $tabCount[$z][1] & @CRLF) _WD_Window($sSession, 'Switch', $tabCount[$z][0]) ConsoleWrite("-- Trying Tab " & $z + 1 & " with URL index " & $i & @CRLF) If _WD_LoadWait($sSession, 0, 0) And $i < $ArrayMax Then ConsoleWrite(@CRLF & "!================================================================== " & $ArrayOfWebsites[$i] & @CRLF & @CRLF) _WD_Attach($sSession, $tabCount[$z][1], "URL") _WD_Navigate($sSession, $ArrayOfWebsites[$i]) $tabCount[$z][1] = $ArrayOfWebsites[$i] $i += 1 EndIf Next ;NOT TO SELF ;Sleep based on how many tabs (should sleep with a variable based on a calculation...come back to this) Switch $Count ;NOT TO SELF ;The need for sleep is reduced with the increase in tabs because it takes time to cycle through the tabs so less sleep is needed for load completion ;However, more tabs means more cpu stress, so I'll need to find a proper balance, probably in the caculation add a component based on cpu load Case 0 Sleep(1400) Case 1 Sleep(1100) Case 2 Sleep(800) Case 3 Sleep(600) Case 4 Sleep(800) ConsoleWrite("!!!!!!!!!!!! Sleep" & @CRLF & @CRLF) Case 5 Sleep(200) Case 6 Sleep(100) Case 7 Sleep(50) Case 7 ; EndSwitch $x += 1 ConsoleWrite("+ Loop " & $x & @CRLF & @CRLF) $6565 = _WD_Status() If IsObj($6565) Then ;ConsoleWrite(@CRLF & $6565.Item('ready') & @CRLF) If $6565.Item('ready') = False Then MsgBox(0,0,"Not ready, exiting.") Exit ;Come back to fix up with _WD_CheckContext instead. EndIf ;ConsoleWrite(@CRLF & ">>>>>>>> First check" & @CRLF) EndIf Until $i = $ArrayMax ;============================================================================================================== MsgBox(0,0,TimerDiff($rr4)) ConsoleWrite(">>> EXIT Loop " & $x & @CRLF & @CRLF) _WD_LoadWait($sSession, 5000, 5000);Give the last page time to fully load before shutting down _WD_DeleteSession($sSession) _WD_Shutdown() Func SetupChrome($Headless = 1, $Mobile = 0) _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'chrome') _WD_CapabilitiesAdd('w3c', True) _WD_CapabilitiesAdd('args', "user-data-dir=C:\\Users\\" & @UserName & "\\AppData\\Local\\Google\\Chrome\\User Data\\Profile 1") If $Headless = 1 Then _WD_CapabilitiesAdd('args', '--headless') If $Mobile = 1 Then _WD_CapabilitiesAdd("mobileEmulation", "deviceName", 'Galaxy S9+') _WD_CapabilitiesAdd('excludeSwitches', 'enable-automation') _WD_CapabilitiesAdd('pageLoadStrategy', 'none') _WD_CapabilitiesDump(@ScriptLineNumber) ; dump current Capabilities setting to console - only for testing in this demo Local $sDesiredCapabilities = _WD_CapabilitiesGet() Return $sDesiredCapabilities EndFunc ;==>SetupChrome My next question however is based on how this switches tabs. Along with the question if attaching can be done based off index, when I watch the tabs switch, the search....SEEMS TO(unless my eyes are deceiving me)....ALWAYS start from the first tab instead of continuing from the current tab. If it's not possible to search by index, would it be possible to start the search from the last tab? Edited August 4, 2023 by Champak
Champak Posted August 4, 2023 Author Posted August 4, 2023 I like your iteration....fancy lol. Else Switch Mod($i, 3) Case 0 _WD_Window($sSession, 'Switch', $_WD_TAB_a) Case 1 _WD_Window($sSession, 'Switch', $_WD_TAB_b) Case 2 _WD_Window($sSession, 'Switch', $_WD_TAB_c) EndSwitch EndIf ...had me confused for a minute. I'll test it when I get a chance.
mLipok Posted August 4, 2023 Posted August 4, 2023 15 minutes ago, Champak said: My next question however is based on how this switches tabs. Along with the question if attaching can be done based off index, when I watch the tabs switch, the search....SEEMS TO(unless my eyes are deceiving me)....ALWAYS start from the first tab instead of continuing from the current tab. If it's not possible to search by index, would it be possible to start the search from the last tab? take a look at my last modifed code - I do not use _WD_Attach... Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24
Champak Posted August 8, 2023 Author Posted August 8, 2023 Getting rid of the attach drastically improved the speed. I went from going through 1000 pages in 20 minutes to doing it in 10 minutes with 5 tabs. I think I'm going to stick with my version for now because it's easier to scale the amount of tabs by ways of user input as far as I see. Thanks.
mLipok Posted August 8, 2023 Posted August 8, 2023 (edited) 1 hour ago, Champak said: because it's easier to scale the amount of tabs by ways of user input as far as I see. ??? I will provide version with requested tabs # Edited August 8, 2023 by mLipok Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24
mLipok Posted August 8, 2023 Posted August 8, 2023 (edited) Please check this out: expandcollapse popup#include "wd_helper.au3" #include "wd_capabilities.au3" Global $sCapabilities = SetupChrome(0) _WD_UpdateDriver('Chrome') _WD_Startup() If @error <> $_WD_ERROR_Success Then MsgBox(0, "Error with chrome startup.", @error) Global $sSession = _WD_CreateSession($sCapabilities) ;Setup an array of urls Global $arrayOfWebsites = [ _ "https://secure1.inmotionhosting.com/index/login", _ "https://cnn.com", _ "https://amazon.com", _ "https://www.wordstream.com/ppc", _ "https://msn.com", _ "https://www.opencart.com", _ "https://thefreedictionary.com", _ "https://www.lohud.com", _ "https://onet.pl", _ "https://google.com", _ "https://www.autoitscript.com/forum", _ "https://github.com", _ "https://stackoverflow.com", _ "https://empik.com", _ "about:blank" _ ] Global $arrayMax = UBound($arrayOfWebsites) - 1 Global $_WD_TAB_array[Int(InputBox('Question', 'How many tabs ?', 3))] Global $_WD_TAB_array_Count = UBound($_WD_TAB_array) Global $_WD_TAB_a, $_WD_TAB_b, $_WD_TAB_c _Example() _WD_DeleteSession($sSession) _WD_Shutdown() Func _Example() For $i = 0 To $arrayMax _TabHelper($i) Next _WD_LoadWait($sSession, 20, 50000) ;Give the last page time to fully load before shutting down MsgBox($MB_TOPMOST, "Info", "Check before end.") EndFunc ;==>_Example Func _TabHelper($i) If $i = 0 Then $_WD_TAB_array[$i] = _WD_Window($sSession, 'WINDOW') ElseIf $i < ($_WD_TAB_array_Count) Then $_WD_TAB_array[$i] = _WD_NewTab($sSession, Default, 0) Else Local $_WD_TAB_Current = $_WD_TAB_array[Mod($i, $_WD_TAB_array_Count)] _WD_Window($sSession, 'Switch', $_WD_TAB_Current) EndIf ConsoleWrite("-- Trying Tab with URL index " & $i & @CRLF) If _WD_LoadWait($sSession, 0, 0) And $i < $arrayMax Then ConsoleWrite(@CRLF & "!================================================================= " & $arrayOfWebsites[$i] & @CRLF & @CRLF) ;Navigate to the next URL in the array _WD_Navigate($sSession, $arrayOfWebsites[$i]) EndIf EndFunc ;==>_TabHelper Func SetupChrome($Headless = 1, $Mobile = 0) _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'chrome') _WD_CapabilitiesAdd('w3c', True) _WD_CapabilitiesAdd('args', "user-data-dir=C:\\Users\\" & @UserName & "\\AppData\\Local\\Google\\Chrome\\User Data\\Profile 1") If $Headless = 1 Then _WD_CapabilitiesAdd('args', '--headless') If $Mobile = 1 Then _WD_CapabilitiesAdd("mobileEmulation", "deviceName", 'Galaxy S9+') _WD_CapabilitiesAdd('excludeSwitches', 'enable-automation') _WD_CapabilitiesAdd('pageLoadStrategy', 'none') _WD_CapabilitiesDump(@ScriptLineNumber) ; dump current Capabilities setting to console - only for testing in this demo Return _WD_CapabilitiesGet() EndFunc ;==>SetupChrome Edited August 8, 2023 by mLipok Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24
mLipok Posted August 9, 2023 Posted August 9, 2023 (edited) There are still some issues, working on Edited August 9, 2023 by mLipok Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24
Champak Posted August 17, 2023 Author Posted August 17, 2023 It seems that I can't get this to run through the tabs with firefox...it's not moving on until fully loaded. I just want to make sure this is the way it's supposed to work (as in not all the features are available to all the browsers), or if there is something extra that needs to be done with firefox.
Danp2 Posted August 17, 2023 Posted August 17, 2023 It should work the same with Firefox as long as you've configured it correctly. Did you perhaps forget to add this line to your setup function? _WD_CapabilitiesAdd('pageLoadStrategy', 'none') Latest Webdriver UDF Release Webdriver Wiki FAQs
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