Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^5: Scrappy user_agent error

by jethro (Monsignor)
on Jan 04, 2012 at 10:16 UTC ( #946216=note: print w/replies, xml ) Need Help??

in reply to Re^4: Scrappy user_agent error
in thread Scrappy user_agent error

Look at the source, first parameter is browser, second parameter the operating system, i.e. you would use something like scraper->user_agent("opera","Macintosh")

PS: As the others have said, if the sites doesn't want robots, you shouldn't just ignore that.

Replies are listed 'Best First'.
Re^6: Scrappy user_agent error
by docster (Novice) on Jan 06, 2012 at 16:51 UTC
    Tested this but it still gives an error. Maybe Scrappy is just not the right tool for this job..
    Can't locate object method "user_agent" via package "scraper" (perhaps + you forgot to load "scraper"?) at ./ line 8. #!/opt/local/bin/perl use strict; use warnings; use Scrappy; my $url = ''; my $scraper = Scrappy->new; scraper->user_agent("opera","Macintosh"); $scraper->get("$url"); print $scraper->domain, "\n"; # print __END__

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://946216]
[Discipulus]: uch; everytime i want to read some source code i finally choke against an XS..

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2016-12-05 10:38 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (79 votes). Check out past polls.