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
RE: LWP Help
by Brian Raven other posts by this author
Jun 17 2009 10:27AM messages near this date
view in the new Beta List Site
LWP Help | Save As option in Win32::OLE
From: perl-win32-users-bounces@[...].com
[mailto:perl-win32-users-bounces@[...].com] On Behalf Of
steve silvers
Sent: 17 June 2009 17:27
To: perl-win32-users@[...].com
Subject: LWP Help

>  I have my below snippet that when I run it from my website, it returns
the query to Yahoo, but all the links 
>  are screwed up?

That's a bit vague. What do you mean by "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 strict; use warnings;" missing. Please include them.

>  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&e
i=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;

Just a guess, but are the links in the returned document relative? If
so, hava a look at the example code in the doco for HTML::LinkExtor.

HTH

-- 
Brian Raven 
This e-mail may contain confidential and/or privileged information. If you are not the inten
ded recipient or have received this e-mail in error, please advise the sender immediately by
 reply e-mail and delete this message and any attachments without retaining a copy.

Any unauthorised copying, disclosure or distribution of the material in this e-mail is stric
tly forbidden.

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Steve Silvers
Brian Raven

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