http://qs1969.pair.com?node_id=11148429


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.