Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^10: Need help with WWW::Mechanize and Chrome cookies

by Corion (Patriarch)
on Jul 11, 2021 at 14:09 UTC ( #11134914=note: print w/replies, xml ) Need Help??


in reply to Re^9: Need help with WWW::Mechanize and Chrome cookies
in thread Need help with WWW::Mechanize and Chrome cookies

This is really weird - what is the value of the URL you're trying to navigate to when that error occurs? Where does that error occur?

  • Comment on Re^10: Need help with WWW::Mechanize and Chrome cookies

Replies are listed 'Best First'.
Re^11: Need help with WWW::Mechanize and Chrome cookies
by bakiperl (Beadle) on Jul 11, 2021 at 14:42 UTC
    I sent you the url.

    The error occurs on both of these calls:
    $mech->get($foo, ':content_file'=>$filename); my $file_content = $mech->get($foo);

      Yes. So what is the value of $foo? Did you print it? Is the loop necessary for the bug to happen, or does the error happen with the hardcoded value for $foo as well?

      From the URL you sent to me, it seems that WWW::Mechanize returns absolute URLs, while WWW::Mechanize::Chrome returns whatever URLs are contained in the file. Simple printing of the values can confirm that to you.

      Until WWW::Mechanize::Chrome achieves API parity with WWW::Mechanize in that part, consider converting the URL to absolute yourself.

        I modified the code to eliminate the loop and I changed the URL to absolute.
        my @urls = map { $_->url_abs } @links;
        The error message went away but these calls still don't return anything.
        $mech->get($foo, ':content_file'=>$filename); my $file_content = $mech->get($foo);

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2023-06-07 13:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (29 votes). Check out past polls.

    Notices?