I want to add a useful tips here:
Connect to existing Chrome window just like WBGet()!
Step 1. Start Chrome with command line: chrome.exe --remote-debugging-port=9222
(Be sure to kill all running Chome windows that didn't start with --remote-debugging-port=9222)
Step 2. Open some webpages manually, then run the following code:
Code: Select all
driver := ChromeGet()
MsgBox, % driver.Window.Title "`n" driver.Url
ChromeGet(IP_Port := "127.0.0.1:9222") {
driver := ComObjCreate("Selenium.ChromeDriver")
driver.SetCapability("debuggerAddress", IP_Port)
driver.Start()
return driver
}
F12::
driver.Start()
MsgBox, % driver.Window.Title "`n" driver.Url
return