On Wed, Mar 13, 2013 at 12:09 PM, G M <[email protected]> wrote:
>
> Hi all,
>
> I'm making an attempt at my first screen scraping script.
>
> For some reason the script doesn't continue after the invocation of the get
> method on the last line:
>
> use strict;
> use WWW::Mechanize;
> use HTML::TokeParser;
> use Data::Dumper;
> print "Content-type: text/html\n\n";
> print "setting up mech<br />";
> my $agent = WWW::Mechanize->new();
> $agent->agent_alias('Windows Mozilla');
> print "mech setup";
> $agent->get('http://www.easyjet.com/en/');
>
>
> Can anyone see anything wrong with this? I've tried double quotes and
> different urls but it doesn't attempt to "get" the page.
>
Hm, what code follows the "get"?
Always a good idea to check for errors in case of site
outage for instance. However this worked for me a few
moments ago when I tried:
$agent->get(...);
die $agent->status unless $agent->success; ";
print "content: $a->content";
--
Charles DeRykus
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/