Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: unable to get response content through WWW::Mechanize

by robby_dobby (Hermit)
on Jun 09, 2015 at 08:11 UTC ( [id://1129625]=note: print w/replies, xml ) Need Help??


in reply to unable to get response content through WWW::Mechanize

Hello arasu84,

When faced with such a situation, you may find that it's helpful to look at what the server returns as a response, by way of headers and status code. For example, since $mech->response is basically HTTP::Response, you can directly look at its status code and response line:

my $resp = $mech->response; if($resp->is_success) { # or $mech->success # do successful stuff } else { # you have failed to get a proper response, inspect what's left of it $resp->status_line; # alternatively, if you have $resp->is_error, you may want to print ou +t the error itself: $resp->error_as_HTML; }
HTH!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-04-23 20:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found