in reply to Parsing Web Page
use HTML::TreeBuilder; my $tree = HTML::TreeBuilder->new; $tree->parse($content); $tree->eof; my @hidden_field_elements = $tree->look_down( _tag => "input", type => "hidden", ); my %hidden_fields = map { $_->attr('name') => $_attr('value') } @hidden_field_elements;
This might work as it is, or it may have some typos in there. You get the <IMG> tag though... Uh... picture.
I must recommend that you not use this method though, because it makes solving this challenge so easy it can only be considered cheating. And you don't wanna be a cheat right?
The man-pages for HTML::Element, ::Parser and ::TreeBuilder are also criminally complete and can easily be used to convince any PHP'r that he's barking up the wrong (pear)tree.
Happy coding!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Parsing Web Page
by Gilimanjaro (Hermit) on Jan 20, 2003 at 23:35 UTC | |
by IlyaM (Parson) on Jan 21, 2003 at 10:32 UTC | |
by Gilimanjaro (Hermit) on Jan 21, 2003 at 10:43 UTC |