Could someone please help me figure out why this is just returning a blank message box instead of displaying the number of rows in the table? I can't figure it out. Source page = https://www.opensecrets.org/federal-lobbying/clients/bills?cycle=2019&id=D000029147
Code: Select all
#Include C:\Users\Hal\Desktop\Chrome.ahk_v1.2\Chrome.ahk
;Assigning source and destination pages
source := Chrome.GetPagebyURL("https://www.opensecrets.org/federal-lobbying/clients/bills")
destination := Chrome.GetPagebyURL("https://ctxt.io/")
;Alerting user if source and destination pages are not open
if !IsObject(source) {
MsgBox, Source wasn't an object
ExitApp
}
if !IsObject(destination) {
MsgBox, Destination wasn't an object
ExitApp
}
;Determining length of table/how many bills there are
js_count_rows = document.getElementsByTagName("tr").length
rowcount := source.Evaluate(js_count_rows)
MsgBox %rowcount%
ExitApp
If I just run the js part (document.getElementsByTagName("tr").length) in the chrome console, it works fine. So I must have messed something up with the ahk.
Any help would be greatly appreciated