Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: LWP::UserAgent Bad and Forbidden requests

by Anonymous Monk
on Dec 15, 2011 at 19:10 UTC ( [id://943814]=note: print w/replies, xml ) Need Help??


in reply to LWP::UserAgent Bad and Forbidden requests

(my browser displays them without a problem):

pretend to be your browser

This is the solution to every such problem, see Re^5: can't get WWW::Mechanize to sign in on JustAnswer or http://www.perl.com/pub/2004/06/04/recorder.html#Web Testing with HTTP::Recorder or WWW::Mechanize::Firefox

  • Comment on Re: LWP::UserAgent Bad and Forbidden requests

Replies are listed 'Best First'.
Re^2: LWP::UserAgent Bad and Forbidden requests
by 1arryb (Acolyte) on Dec 15, 2011 at 20:07 UTC
    Hi Anonymous,

    In general, changing your user agent string to spoof Firefox, for example, is not a legitimate workaround. LWP::UserAgent is kind of a grey area, since you could use it to build interactive, as well as automated web applications. However, the folks at sciencedirect.com are clearly taking a hard line against it. If taioma chooses to spoof his user agent from a spider, and it is detected, he could get himself (and his whole company) banned.

    Cheers,

    Larry

      I agree that spoofing another user agent is an ugly hack, however setting an appropriate user agent is always a good idea:

      my $ua = LWP::UserAgent->new(agent => 'MyApp/0.1');

      In general, changing your user agent string to spoof Firefox, for example, is not a legitimate workaround.

      says who?

      and his whole company) banned.

      I am not a lawyer, I don't give legal advice

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://943814]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-26 09:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found