Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Issue is that the site is in asp and on fetching the contents the contents is something in coded form. I tried WWW::Mechanize but the same output in javascript and encoded form.
I tried WWWW::Mechanize::Firefox but it was not even able to login to the website, it simply says no such fields found
Then I go with HTML::TreeBuilderX::ASP_NET, but I could not understand exactly how to use it.
Even in mechanize I tried to post the __EVENTVALIDATION and __VIEWSTATEbut again No Luck there too. Can anyone help me in this, posting here is the sample WWW::Mechanize program:Code for WWW::Mechanize::Firefox:#!/usr/bin/perl use WWW::Mechanize; my $mech = WWW::Mechanize->new(autocheck => 0, autodie => 0); $mech->agent('wonderbot/JS 1.0'); $mech->cookie_jar(HTTP::Cookies->new()); $mech->get('https://XXXXX.aspx'); my $email = 'XXXX'; my $password = 'XXXX'; my $org_id = 'XXXXXX'; $mech->form_id('loginForm'); $mech->field('sUserName' => $email); $mech->field('sPassword' => $password); $mech->field('sParentUID' => $org_id); #$mech->field('__EVENTVALIDATION' => $__EVENTVALIDATION); #$mech->field('__VIEWSTATE' => $__VIEWSTATE); $mech->click(); $mech->get('https://YYYY.aspx');#going to another link on the same web +site my $html_string = $mech->content(); print $html_string;
Any help in this would be deeply regarded. Thanks#!/usr/bin/perl use WWW::Mechanize; my $mech = WWW::Mechanize->new(autocheck => 0, autodie => 0); $mech->agent('wonderbot/JS 1.0'); $mech->cookie_jar(HTTP::Cookies->new()); $mech->get('https://XXXXX.aspx'); my $email = 'XXXX'; my $password = 'XXXX'; my $org_id = 'XXXXXX'; $mech->form_id('loginForm'); $mech->field('sUserName' => $email); $mech->field('sPassword' => $password); $mech->field('sParentUID' => $org_id); #$mech->field('__EVENTVALIDATION' => $__EVENTVALIDATION); #$mech->field('__VIEWSTATE' => $__VIEWSTATE); $mech->click(); $mech->get('https://YYYY.aspx');#going to another link on the same web +site my $html_string = $mech->content(); print $html_string;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to scraper ASP websites
by Corion (Patriarch) on Sep 05, 2012 at 05:28 UTC | |
|
Re: How to scraper ASP websites
by Gangabass (Vicar) on Sep 05, 2012 at 15:04 UTC | |
by Anonymous Monk on Sep 05, 2012 at 20:07 UTC | |
by davido (Cardinal) on Sep 06, 2012 at 06:42 UTC | |
by 2teez (Vicar) on Sep 06, 2012 at 05:22 UTC | |
by Anonymous Monk on Sep 06, 2012 at 06:56 UTC | |
by Athanasius (Archbishop) on Sep 06, 2012 at 07:31 UTC | |
by Anonymous Monk on Sep 06, 2012 at 07:44 UTC | |
|