SpacemanSpiff has asked for the wisdom of the Perl Monks concerning the following question:
For all I know, that works just fine. Being that I want to verify that before I move on, how do I view the contents of $stream? A print function simply gives me "HTML::TokeParser=HASH(0x22dcd84)" as I'm suspecting it should. Past experiences have taught me that sometimes "as_text" or a garden variety of other text commands will format it as I expect, but I've been unable to figure it out for TokeParser. Can someone illustrate what's happening and how I can deal with this in the future? I'm sure my next problem beyond this will be cookie handling, but I'll leave that for another time. (Yes, I've rtfm, but being new, the answer has thus far escaped me) Thanks in advance!#!/usr/bin/perl -w use strict; use WWW::Mechanize; use HTML::TokeParser; my $agent = WWW::Mechanize->new(); $agent->get("http://www.perlmonks.com/"); my $stream = HTML::TokeParser->new(\$agent->{content}); $stream->get_tag("ul");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing web data by tag... help?
by davido (Cardinal) on Sep 06, 2005 at 16:28 UTC | |
|
Re: Parsing web data by tag... help?
by Zaxo (Archbishop) on Sep 06, 2005 at 16:32 UTC | |
|
Re: Parsing web data by tag... help?
by davidrw (Prior) on Sep 06, 2005 at 16:32 UTC | |
|
Re: Parsing web data by tag... help?
by Ovid (Cardinal) on Sep 06, 2005 at 18:46 UTC | |
by SpacemanSpiff (Sexton) on Sep 06, 2005 at 21:08 UTC |