in reply to Re^3: How to output the words that you want that came thru an html file?
in thread How to output the words that you want that came thru an html file?

See HTML::TreeBuilder::XPath

my $tree = HTML::TreeBuilder::XPath->new; $tree->parse_content( $content ); my $key = $tree->findvalue('td');

See also Web::Magic::Examples

  • Comment on Re^4: How to output the words that you want that came thru an html file?
  • Download Code

Replies are listed 'Best First'.
Re^5: How to output the words that you want that came thru an html file?
by tobyink (Canon) on May 04, 2012 at 13:51 UTC

    This works for me. :-) A few too many blank lines in the output perhaps.

    use Modern::Perl; use HTML::HTML5::ToText; use Web::Magic -quotelike => 'web'; my $converter = HTML::HTML5::ToText->with_traits(qw/ShowLinks/)->new; web <http://www.gamezebo.com/games/marvel-avengers-alliance/walkthroug +h> -> assert_success -> querySelectorAll('div.walkthrough_section') -> foreach(sub { print $converter->process($_); })

    Disclaimer: I'm the author of both HTML::HTML5::ToText and Web::Magic.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'