AHK: Chrome_selenium

Get help with using AutoHotkey and its commands and hotkeys
inseption86
Posts: 70
Joined: 19 Apr 2018, 00:24

AHK: Chrome_selenium

02 Apr 2019, 10:01

Hi guys, to work with a new tab, I get the object associated with it by url

Code: Select all

ie := ComObjCreate("InternetExplorer.Application")
ie.Visible := true
ie.Navigate("https://www.google.com")
ie.Navigate("https://www.autohotkey.com",2048)

q::
 ie := WBFromUrl(""https://www.google.com")
 return
 
 w::
 ie2 := WBFromUrl("https://www.autohotkey.com")
 return

WBFromUrl(url)  {
   shell := ComObjCreate("Shell.Application")
   loop  {
      for window in shell.Windows  {
         if (window.LocationUrl = url)
            break 2
      }
      Sleep 10
   }
   Return window
}

Is it possible to do this in chrome?

Code: Select all


driver := ComObjCreate("Selenium.ChromeDriver")
driver.AddArgument("--disable-infobars")
driver.AddArgument("--start-maximized") 

driver.Get("https://www.google.com")

driver.ExecuteScript("window.open();")
driver.SwitchToNextWindow
driver.Get("https://www.autohotkey.com")

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot], Renets, TAC109 and 172 guests