G33kDude / Chrome.ahk

Automate Google Chrome using native AutoHotkey
https://autohotkey.com/boards/viewtopic.php?t=42890
MIT License
340 stars 83 forks source link

Help with Dropdown selection #14

Closed dagiccross closed 4 years ago

dagiccross commented 4 years ago

Include ../Chrome.ahk

FileCreateDir, ChromeProfile ChromeInst := new Chrome("ChromeProfile")

PageInst := ChromeInst.GetPage() PageInst.Call("Page.navigate", {"url": "https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select"}) PageInst.WaitForLoad()

PageInst.Evaluate("document.getElementsByName(""cars"")[0].options[1].selected=true")

Unable to call this JS function..

dagiccross commented 4 years ago

It turns out w3schools is not the best example for testing out codes... It actually worked on a normal website with dropdown lists.