docster has asked for the wisdom of the Perl Monks concerning the following question:
#!/opt/local/bin/perl use strict; use warnings; use Scrappy qw/:syntax/; user_agent random_ua; my $url = 'http://google.com'; my $scraper = Scrappy->new; $scraper->get("$url"); print $scraper->domain; # print www.google.com __END__ This script returns: Can't locate object method "user_agent" via package "random_ua" (perha +ps you forgot to load "random_ua"?) at ./scrappy.pl line 5.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Scrappy user_agent error
by marto (Cardinal) on Jan 03, 2012 at 16:43 UTC | |
by docster (Novice) on Jan 03, 2012 at 16:54 UTC | |
by jethro (Monsignor) on Jan 03, 2012 at 17:51 UTC | |
by docster (Novice) on Jan 03, 2012 at 18:45 UTC | |
by jethro (Monsignor) on Jan 04, 2012 at 10:16 UTC | |
| |
by roboticus (Chancellor) on Jan 04, 2012 at 04:01 UTC | |
by GrandFather (Saint) on Jan 03, 2012 at 23:43 UTC | |
Re: Scrappy user_agent error
by Anonymous Monk on Jan 04, 2012 at 00:12 UTC | |
Re: Scrappy user_agent error
by docster (Novice) on Jan 06, 2012 at 16:58 UTC |