CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
could somebody explain what mech success checks for

 



gerble1000
User

May 30, 2012, 9:51 AM

Post #1 of 2 (816 views)
could somebody explain what mech success checks for Can't Post

i have a script that has a lot of "unless mech success"
what does it actually check for.
i mean i expect it to not be a success if the page does not load.
but what if its a login page and the password was wrong.
what defines a success


Zhris
Enthusiast

May 30, 2012, 1:19 PM

Post #2 of 2 (813 views)
Re: [gerble1000] could somebody explain what mech success checks for [In reply to] Can't Post

Hi,

You would need to supply code for us to understand "unless mech success". I assume you refer to WWW::Mecahnize's success method. WWW::Mechanize is a subclass of LWP::UserAgent. The WWW::Mechanize success method is an accessor to the LWP::UserAgent is_success method. The is_success method returns a true value when a response has a successful HTTP status code i.e. 200. Its useful to combine web browsing with HTML parsing techniques. For example if you attempt to login, you could check what the resultant HTML looks like to decide whether you have successfully logged in or not.

Chris

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives