Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: about retrieving and parsing html without writing on disk

by rizzo (Chaplain)
on Apr 10, 2018 at 00:30 UTC ( #1212618=note: print w/replies, xml ) Need Help??


in reply to Re: about retrieving and parsing html without writing on disk
in thread about retrieving and parsing html without writing on disk

Maybe have a look at $string = $mech->content(...) from WWW::Mechanize

and maybe at HTTP::Response as well, because

$mech->get( $uri )

returns an object of that type.

Replies are listed 'Best First'.
Re^3: about retrieving and parsing html without writing on disk
by Your Mother (Bishop) on Apr 10, 2018 at 06:10 UTC

    Good note for checking $response->code and such. Along those lines, for the OP, if you use WWW::Mechanize remember that it fails hard, dies, on any non-success responses, 400s and 500s, unless you set autocheck => 0. You also have access to the response object from the mech object with $mech->response so you don't necessarily need a new variable for it.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2020-10-01 22:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (22 votes). Check out past polls.

    Notices?