in reply to Formating a HTML document to show certain text.
- $ lwp-download http://www.imreportcard.com/products/the-elevation-group
Saving to 'the-elevation-group.htm'...
35.2 KB received
- $ perl htmltreexpather.pl
the-elevation-group.htm 2>NUL |grep -A3 "^Product Description$"
Product Description
/html/body/div/div[3]/div/div/div[6]
//div[@id='leftColTop']/div[6]
//div[@id='leftColTop']/div[@class='heading']
- use HTML::TreeBuilder::XPath; my $tree= HTML::TreeBuilder::XPath->new; $tree->parse_file( "the-elevation-group.htm"); for my $n( $tree->findnodes( q#//div[@id='leftColTop']/div[@class='heading']# ) ){ print $n->getValue, "\n"; } __END__ Product Description Detailed Overview Reputation Domain "Whois"
- repeat
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Formating a HTML document to show certain text.
by Anonymous Monk on Mar 28, 2011 at 06:52 UTC |
In Section
Seekers of Perl Wisdom