Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Using LWP (or some other module) to Dowload HTML with Cookie Session ID

by Leudwinus (Scribe)
on Nov 28, 2022 at 23:50 UTC ( [id://11148429]=note: print w/replies, xml ) Need Help??


in reply to Re: Using LWP (or some other module) to Dowload HTML with Cookie Session ID
in thread Using LWP (or some other module) to Dowload HTML with Cookie Session ID

Thank you, Corion for that example and link to your page which I have bookmarked!

It looks like the content I need is then stored in $res->{_content}. I had to first install LWP::UserAgent and LWP::Protocol::https to get this to work though.

I guess I need to get more familiar with the LWP, LWP::UserAgent and HTTP::Request modules.

What is the difference between LWP::UserAgent and Mojo::UserAgent, the latter which was also suggested to me to try to solve this?

Thanks again!

  • Comment on Re^2: Using LWP (or some other module) to Dowload HTML with Cookie Session ID
  • Download Code

Replies are listed 'Best First'.
Re^3: Using LWP (or some other module) to Dowload HTML with Cookie Session ID
by Corion (Patriarch) on Nov 29, 2022 at 08:17 UTC

    No - please use $res->decoded_content instead of reaching into the HTTP::Response hash.

    The difference between LWP::UserAgent and Mojo::UserAgent is mostly that LWP::UserAgent doesn't allow for parallel requests. Mojo::UserAgent is a bit more complex due to allowing for parallelism, but it also offers some more convenience stuff like handling JSON replies directly.

      Ok, thank you again Corion! As you can clearly tell, I have no idea what I am doing!

      And thank you for clarifying the differences between LWP::UserAgent and Mojo::UserAgent.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-20 00:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found