Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
more useful options
 
PerlMonks  

Re^4: How to output the words that you want that came thru an html file?

by Anonymous Monk
on May 04, 2012 at 13:22 UTC ( #968921=note: print w/ replies, xml ) Need Help??


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
Re^5: How to output the words that you want that came thru an html file?
by tobyink (Prior) 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'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://968921]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2013-05-20 02:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best material for plates (tableware) is:









    Results (402 votes), past polls