Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: How do I get WWW::Mechanize::PhantomJS to wait until the JavaScript on the web page has finished executing?

by LanX (Saint)
on Aug 21, 2021 at 11:11 UTC ( [id://11136001]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How do I get WWW::Mechanize::PhantomJS to wait until the JavaScript on the web page has finished executing?
in thread How do I get WWW::Mechanize::PhantomJS to wait until the JavaScript on the web page has finished executing?

Using one of the selectors in WWW::Mechanize::PhantomJS to find a "finished" characteristic (DOM element or attribute or combination or ...) should return an empty result unless it exists. (See all EXTRACTION-METHODS)

And even if this didn't work, you could ->eval your own JS-code which does those checks in a loop for you and only returns after success.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

  • Comment on Re^3: How do I get WWW::Mechanize::PhantomJS to wait until the JavaScript on the web page has finished executing?
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11136001]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-24 22:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found