ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-win32-users
perl-win32-users
LWP Help
by Steve Silvers other posts by this author
Jun 17 2009 9:27AM messages near this date
view in the new Beta List Site
RE: :FTP pasv_xfer() using problem | RE: LWP Help
I have my below snippet that when I run it from my website, it returns the query to Yahoo, b
ut all the links are screwed up?
 
How do I fix this? Also how can I add multiple searches to this for one call.
 
Thanks in advance.
 
#!/usr/bin/perl
use LWP::UserAgent;
print "Content-type: text/html\n\n";
my $ua = new LWP::UserAgent;
my $url = "http://search.yahoo.com/search?p=trucks&fr=yfp-t-501&toggle=1&cop=mss&ei=UTF-8";
my $response = $ua-> get($url);
if($response-> content_type ne "text/html"){
die("Recieved content-type ".$response-> content_type.", was
looking for text/html.")
}
my $content = $response-> content; # $content now holds the html page from google.
print $content;

_________________________________________________________________
Bing�  brings you maps, menus, and reviews organized in one place.   Try it now.
http://www.bing.com/search?q=restaurants&form=MLOGEN&publ=WLHMTAG&crea=TEXT_MLOGEN_Core_tagl
ine_local_1x1
Thread:
Steve Silvers
Brian Raven

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved