It stuck on random place on page (it can be 1st page from script start. and it can be 5 or 10 page~) . And if I restart script on that page, it works correct.
What I have:
Code: Select all
PageInst := Chrome.GetPage(1)
While (flag = 1)
{
numEl := PageInst.Evaluate("document.getElementsByClassName('class-name').length;").Value
Loop %numEl%
{
lnk := "document.getElementsByClassName('class-name')[" . A_Index - 1 . "].href;"
FileAppend, % "`n" . "1 " . numEl . " " . A_Index - 1 . " " . lnk, %LogFile%
El := PageInst.Evaluate(lnk).Value
FileAppend, % "`n" . "2 " . A_Index - 1 . " " . El, %LogFile%
elL.Push(El)
}
[Some more code that works with links and then move to next page]
}
If I double click on script in tray it is full of
After that I'm checking my log and find that it's last string is245: Sleep,50 (0.05)
244: While,!this.responses[ID]
Going to page->F12->insert document.getElementsByClassName('class-name')[3].href; in console->Enter.1 10 3 document.getElementsByClassName('class-name')[3].href;
And there's nothing interesting.
Link is standart for that site
Code: Select all
https://www.site.com/author/section/name-of-the-page-1234567890
Based on LOG materials of 15+ stucks, so there's really nothing unifying in them.