SPUG: parsing a web page

Peter Darley pdarley at kinesis-cem.com
Thu Sep 16 14:21:00 CDT 2004


Luis,
	It's not clear what you are wanting to do here.  The get returns the
contents of the page as a single string, not an array, so you just get one
blob that contains the entire page.  Usually to get the content out that you
want you looks for stuff using regular expressions.  Perhaps a bit more info
on what you're looking for would help?
Thanks,
Peter Darley

-----Original Message-----
From: spug-list-bounces at mail.pm.org
[mailto:spug-list-bounces at mail.pm.org]On Behalf Of Luis Medrano
Sent: Thursday, September 16, 2004 12:03 PM
To: Perl List
Subject: SPUG: parsing a web page


List,
I'm trying to parse a web page but I don't understand the following:
1.-I get the content of the page using this script:

#!/usr/bin/perl
use LWP::Simple;
@content=get("http://google.com");
print "$content[0] \n";

2.-but all the content is $content[0] like if was just one line of content.

Any of you know what is going on?

Thanks,
Luis

_____________________________________________________________
Seattle Perl Users Group Mailing List
POST TO: spug-list at mail.pm.org  http://spugwiki.perlocity.org
ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list
MEETINGS: 3rd Tuesdays, Location Unknown
WEB PAGE: http://www.seattleperl.org



More information about the spug-list mailing list