SPUG: parsing a web page

Luis Medrano lmzaldivar at mac.com
Thu Sep 16 14:29:33 CDT 2004


What I'm triying to do is not to get a blob as you called (everything in one string). what I want to get is the content into in array and my question is how can I do that?. 
If you can help me or point me on how to do this it will be just great.

Thanks,
Luis

 
On Thursday, September 16, 2004, at 12:21PM, Peter Darley <pdarley at kinesis-cem.com> wrote:

>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