asp.net - Bypass asp login with Mechanize -
i have problems login in asp page.
here code:
#!/usr/bin/perl -w use strict; use warnings; use www::mechanize; use lwp::debug qw(+); $mech = www::mechanize->new; $mech->agent('user-agent=mozilla/4.0'); $mech->get( 'http://site.net/index.asp' ); $mech->submit_form( form_name => 'form', fields => { xpto => '123' } ); $app_content = $mech->content(); print "$app_content\n"; and that's terminal:
<html> <head> <title>anti bot</title> </head> <body> <h1 style="color:red;">bots not allowed here</h1> </body> </html>
either it's detecting user agent weird (most not start "user-agent="), or there's javascript in form setting (or removing) fields during normal submission via browser. try filling out login form in browser , observing posted (via firebug, etc), , updating script match. alternatively, use web scraping library can run javascript, such www::mechanize::firefox.
i assuming, of course, have permission doing this. people have reasons not wanting bots on site.
Comments
Post a Comment