Perl: adding error checking -
i have following code , wondered how add error checking?
my $login = "https://steamcommunity.com/login/home/?goto=market%2f"; $username = "usr"; $password = "pass"; $mech = www::mechanize->new(); $mech->cookie_jar(http::cookies->new()); $mech->get($login); $mech->form_name('loginform'); $mech->field(login => $username); $mech->field(passwd => $password); $mech->click();
thanks in advance seb morris
there no "error condition" such when internet login fails. have @ html returned site check whatever text sent when login fails.
you should use html::treebuilder::xpath
parse , navigate html.
note many sites use javascript modify page after has been delivered client. www::mechanize
doesn't support javascript, may not able want.
Comments
Post a Comment