Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^4: help clicking radio buttons using WWW::Mechanize::Chrome

by Special_K (Monk)
on Jan 15, 2021 at 18:30 UTC ( [id://11126968]=note: print w/replies, xml ) Need Help??


in reply to Re^3: help clicking radio buttons using WWW::Mechanize::Chrome
in thread help clicking radio buttons using WWW::Mechanize::Chrome

I noticed that adding the following line from your example fixed my code:

$mech->sleep(5);

Generally speaking, should one always call $mech->sleep(); after a call to $mech->get() (and possibly other methods)? I didn't see this explicitly mentioned in the documentation for the get() method but I'm not a web developer so maybe it's just common knowledge that something like that is required?

Replies are listed 'Best First'.
Re^5: help clicking radio buttons using WWW::Mechanize::Chrome
by Corion (Patriarch) on Jan 15, 2021 at 22:32 UTC

    This depends on the page. In theory it should not be necessary, but if the page loads other Javascript scripts and more content before it "really" displays the content, this cannot be detected by WWW::Mechanize::Chrome. In such cases, you need to blindly call ->sleep() and hope that the content arrives in time.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-26 05:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found