Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: LWP simple question

by imp (Priest)
on May 24, 2007 at 04:04 UTC ( [id://617161]=note: print w/replies, xml ) Need Help??


in reply to LWP simple question

They are probably just checking the user agent. This worked for me:
#!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; my $amazon_url = q{http://www.amazon.com/exec/obidos/ASIN/0394756673/r +ef=nosim/bookreadersre-20}; my $ua = LWP::UserAgent->new; $ua->agent('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3 +) Gecko/20070309 Firefox/2.0.0.3'); my $response = $ua->get($amazon_url); my $page = $response->content; my $sought_string = q{offer-listing}; if ($page =~ /$sought_string/){ print "Found it\n"; } else { print "No luck\n"; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-19 07:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found