Special thanks and shout out has to go to Joe Glines for providing much knowledge and great tutorials that started me on this path and Loving AutoHotkey...
I have successfully connected to a running instance of chrome(in debug mode), and am able to "findElementByClass", for an array with the attribute set at .Attribute("textContent") for a particular class name.. The code I am using seems to only return the very FIRST item in the Array, even when I do not include "item[1]" and add the "s" to the argument.. ie .... "findElementsByClass" .
What I am trying to do is grab the entire array list .Attribute("textContent") for that class.. The number of items in the array changes every few seconds, and I know that I can only get what I get at the instance that the script runs... Or even better, once I am able to get the entire list i would like to iterate over it continually every few seconds or whatever I need number wise.. Grab all the text, then (Final Project goal), eventually be able to search that text for particular strings and the SendKeys and or mouse clicks (Actually both), once script is completed..
Right now though, I am just trying to grab the text from the entire array and display it in a msgbox
Here is the code current code:
Code: Select all
#SingleInstance,Force
LCONTROL::Reload
RCONTROL::
;******************** Connect to Chrome and Find Elements from within the Site ***********************************
driver := ChromeGet()
;~MsgBox, % driver.Title "`n" driver.Url
MsgBox % driver.findElementByClass("_ghbghb") .Attribute("textContent")
return
ChromeGet(IP_Port := "127.0.0.1:9222") {
driver := ComObjCreate("Selenium.ChromeDriver")
driver.SetCapability("debuggerAddress", IP_Port)
driver.Start()
return driver
}
Thanks!