TheOne23 Posted June 23, 2020 Share Posted June 23, 2020 Hi AutoIT Folks, May i seek your help regarding Chrome Automation. I am unable to make a simple run of the below script. Just new with the chrome automation since IE is having limitations already. Thank you. Local $sDesiredCapabilities, $iIndex, $sSession Local $nMsg, $lProcess = False Local $sDesiredCapabilities, $sSession SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) ;Login _WD_NewTab($sSession) _WD_Navigate($sSession, "https://www.autoitscript.com/site/") _WD_Shutdown() Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true }}}}' EndFunc Link to comment Share on other sites More sharing options...
Nine Posted June 23, 2020 Share Posted June 23, 2020 Have gone thru the this wiki link ? TheOne23 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Danp2 Posted June 23, 2020 Share Posted June 23, 2020 16 minutes ago, TheOne23 said: I am unable to make a simple run of the below script. <sarcasm> I'm guessing that you forgot to hit F5 to run the script in Scite. Otherwise, I can't imagine why you wouldn't have shown the output from the Scite console so that we can actually help you. </sarcasm> 😜 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
TheOne23 Posted June 23, 2020 Author Share Posted June 23, 2020 Hi Nine, Checking on it now. Just an overview of the output I would like to share below: >"D:\Backup\Back_up for new Laptop\D\Tools\AutoIT v3.3.14.3\autoit-v3\install\SciTe\..\autoit3.exe" /ErrorStdOut "D:\Automations\Chrome Automation\WebDriver-0.3.0.3\WebDriver-0.3.0.3\Chrome_test.au3" _WD_IsLatestRelease: True _WD_IsLatestRelease ==> Success _WDStartup: OS: WIN_10 WIN32_NT 16299 _WDStartup: AutoIt: 3.3.14.5 _WDStartup: WD.au3: 0.3.0.3 (Up to date) _WDStartup: WinHTTP: 1.6.4.1 _WDStartup: Driver: chromedriver.exe _WDStartup: Params: --log-path="D:\Automations\Chrome Automation\WebDriver-0.3.0.3\WebDriver-0.3.0.3\chrome.log" _WDStartup: Port: 9515 __WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true }}}} __WD_Post: StatusCode=500; ResponseText={"value":{"error":"session not created","message":"session not created: This version of ChromeDriver... __WD_Post ==> Timeout: {"value":{"error":"session not created","message":"session not created: This version of ChromeDriver only supports Chrome version 84","stacktrace":"Backtrace:\n\tOrdinal0 [0x00B087E3+2852835]\n\tOrdinal0 [0x009F5BB1+1727409]\n\tOrdinal0 [0x008CE4B9+517305]\n\tOrdinal0 [0x00860BA0+68512]\n\tOrdinal0 [0x0085D3A0+54176]\n\tOrdinal0 [0x0087D9F7+186871]\n\tOrdinal0 [0x0087D7FD+186365]\n\tOrdinal0 [0x0087B70B+177931]\n\tOrdinal0 [0x00862584+75140]\n\tOrdinal0 [0x00863650+79440]\n\tOrdinal0 [0x008635E9+79337]\n\tOrdinal0 [0x00A0AD5C+1813852]\n\tGetHandleVerifier [0x00C2C616+1075574]\n\tGetHandleVerifier [0x00C2C367+1074887]\n\tGetHandleVerifier [0x00C37497+1120247]\n\tGetHandleVerifier [0x00C2CC16+1077110]\n\tOrdinal0 [0x00A03206+1782278]\n\tOrdinal0 [0x00A0C3BB+1819579]\n\tOrdinal0 [0x00A0C523+1819939]\n\tOrdinal0 [0x00A22B45+1911621]\n\tBaseThreadInitThunk [0x750E8674+36]\n\tRtlGetAppContainerNamedObjectPath [0x779F5EC7+311]\n\tRtlGetAppContainerNamedObjectPath [0x779F5E97+263]\n"}} _WD_CreateSession: {"value":{"error":"session not created","message":"session not created: This version of ChromeDriver only supports Chrome version 84","stacktrace":"Backtrace:\n\tOrdinal0 [0x00B087E3+2852835]\n\tOrdinal0 [0x009F5BB1+1727409]\n\tOrdinal0 [0x008CE4B9+517305]\n\tOrdinal0 [0x00860BA0+68512]\n\tOrdinal0 [0x0085D3A0+54176]\n\tOrdinal0 [0x0087D9F7+186871]\n\tOrdinal0 [0x0087D7FD+186365]\n\tOrdinal0 [0x0087B70B+177931]\n\tOrdinal0 [0x00862584+75140]\n\tOrdinal0 [0x00863650+79440]\n\tOrdinal0 [0x008635E9+79337]\n\tOrdinal0 [0x00A0AD5C+1813852]\n\tGetHandleVerifier [0x00C2C616+1075574]\n\tGetHandleVerifier [0x00C2C367+1074887]\n\tGetHandleVerifier [0x00C37497+1120247]\n\tGetHandleVerifier [0x00C2CC16+1077110]\n\tOrdinal0 [0x00A03206+1782278]\n\tOrdinal0 [0x00A0C3BB+1819579]\n\tOrdinal0 [0x00A0C523+1819939]\n\tOrdinal0 [0x00A22B45+1911621]\n\tBaseThreadInitThunk [0x750E8674+36]\n\tRtlGetAppContainerNamedObjectPath [0x779F5EC7+311]\n\tRtlGetAppContainerNamedObjectPath [0x779F5E97+263]\n"}} _WD_CreateSession ==> Webdriver Exception: HTTP status = 500 __WD_Get: URL=HTTP://127.0.0.1:9515/session//window/handles __WD_Get: StatusCode=404; $iResult = 0; $sResponseText={"value":{"error":"invalid session id","message":"invalid session id","stacktrace":"Backtrace:\n\tOr... _WD_Window: {"value":{"error":"invalid session id","message":"invalid session id","stacktrace":"Backtrace:\n\tOr... _WD_Window ==> Invalid session ID: HTTP status = 404 _WD_NewTab ==> Webdriver Exception __WD_Post: URL=HTTP://127.0.0.1:9515/session//url; $sData={"url":"https://www.autoitscript.com/site/"} __WD_Post: StatusCode=404; ResponseText={"value":{"error":"invalid session id","message":"invalid session id","stacktrace":"Backtrace:\n\tOr... _WD_Navigate: {"value":{"error":"invalid session id","message":"invalid session id","stacktrace":"Backtrace:\n\tOrdinal0 [0x00B087E3+2852835]\n\tOrdinal0 [0x009F5BB1+1727409]\n\tOrdinal0 [0x008CE362+516962]\n\tOrdinal0 [0x008620E9+73961]\n\tOrdinal0 [0x0087B7D7+178135]\n\tOrdinal0 [0x0087A25A+172634]\n\tOrdinal0 [0x00879E34+171572]\n\tOrdinal0 [0x0085234E+9038]\n\tOrdinal0 [0x008527A6+10150]\n\tOrdinal0 [0x00852E40+11840]\n\tOrdinal0 [0x00A0AD5C+1813852]\n\tGetHandleVerifier [0x00C2C616+1075574]\n\tGetHandleVerifier [0x00C2C367+1074887]\n\tGetHandleVerifier [0x00C37497+1120247]\n\tGetHandleVerifier [0x00C2CC16+1077110]\n\tOrdinal0 [0x00A03206+1782278]\n\tOrdinal0 [0x0085220B+8715]\n\tOrdinal0 [0x00851F18+7960]\n\tGetHandleVerifier [0x00DFBBCC+2973484]\n\tBaseThreadInitThunk [0x750E8674+36]\n\tRtlGetAppContainerNamedObjectPath [0x779F5EC7+311]\n\tRtlGetAppContainerNamedObjectPath [0x779F5E97+263]\n"}} _WD_Navigate ==> Invalid session ID: HTTP status = 404 >Exit code: 0 Time: 4.06 Link to comment Share on other sites More sharing options...
Danp2 Posted June 23, 2020 Share Posted June 23, 2020 9 minutes ago, TheOne23 said: _WDStartup: WinHTTP: 1.6.4.1 Please grab the latest source from here. Quote {"value":{"error":"session not created","message":"session not created: This version of ChromeDriver only supports Chrome version 84" This is your true issue that needs to be resolved. What version of Chrome and Chromedriver are you attempting to use? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
TheOne23 Posted June 23, 2020 Author Share Posted June 23, 2020 Hi Danp2, I am using Version 83.0.4103.106 (Official Build) (64-bit) and used this driver: ChromeDriver 83.0.4103.14 since there is no exact version in the list of downloadable in the download page. I am downloading now the latest version of _WDStartup: WinHTTP: 1.6.4.1 Thank you. Link to comment Share on other sites More sharing options...
Danp2 Posted June 23, 2020 Share Posted June 23, 2020 From their website -- Current stable release: ChromeDriver 83.0.4103.39 TheOne23 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
TheOne23 Posted June 23, 2020 Author Share Posted June 23, 2020 Hi Dan, I will try it now. Thank you. Link to comment Share on other sites More sharing options...
TheOne23 Posted June 23, 2020 Author Share Posted June 23, 2020 Hi Dan, It is working perfectly now! Thank you very much! You're the Man Bro! I have another query, if you have a function that will do web scraping of innertext from a web page. Thank you. MarkIT 1 Link to comment Share on other sites More sharing options...
Danp2 Posted June 23, 2020 Share Posted June 23, 2020 Yes, but you'll need to be be more specific. Do you want to retrieve the innertext of the entire page or from a single element? MarkIT 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
TheOne23 Posted June 23, 2020 Author Share Posted June 23, 2020 Hi Danp2, I would like to learn both if you have the function that I can check into. Thank you in advance. MarkIT 1 Link to comment Share on other sites More sharing options...
Danp2 Posted June 23, 2020 Share Posted June 23, 2020 For elements, take a look at _WD_ElementAction, which you can use to retrieve the properties and attributes of an element you previously located with _WD_FindElement. For the entire page, there's _WD_GetSource, but I'm not sure that will give you what you want. MarkIT and TheOne23 1 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
TheOne23 Posted June 23, 2020 Author Share Posted June 23, 2020 Hi Danp2, Thank you very much on the inputs. Really informative and helped me a lot. I will play around on the functions you suggested. Thank you! MarkIT 1 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