SPUG: parsing a web page

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


Luis,
	The problem is that it comes from the server all as one string.
	How do you want to break it up? One array element per line?  One array
element per html tag? What?
Thanks,
Peter Darley

-----Original Message-----
From: Luis Medrano [mailto:lmzaldivar at mac.com]
Sent: Thursday, September 16, 2004 12:30 PM
To: Peter Darley
Cc: Perl List
Subject: RE: SPUG: parsing a web page



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