[root@node01 jquery]# cat a6.html
<p title="选择你最喜欢的水果.">狗年快乐<strong>你最喜欢的水果是?</strong></p>
<script type="text/javascript" src="jquery-2.2.2.min.js"></script>
<script type="text/javascript" src="a6.js"></script>
[root@node01 jquery]#
[root@node01 jquery]#
[root@node01 jquery]# vim a6.pl
[root@node01 jquery]#
[root@node01 jquery]# cat a6.pl
use LWP::UserAgent;
use POSIX;
use HTML::TreeBuilder::XPath;
use Encode;
use HTML::TreeBuilder;
use Data::Dumper;
use HTML::TreeBuilder::XPath;
use DBI;
use Encode;
my $tree= HTML::TreeBuilder::XPath->new;
$tree->parse_file("a6.html");
my @pageString = $tree->findvalues('//p');
print @pageString;
[root@node01 jquery]# perl a6.pl
狗年快乐你最喜欢的水果是?[root@node01 jquery]#
[root@node01 jquery]# cat a6.pl
use LWP::UserAgent;
use POSIX;
use HTML::TreeBuilder::XPath;
use Encode;
use HTML::TreeBuilder;
use Data::Dumper;
use HTML::TreeBuilder::XPath;
use DBI;
use Encode;
my $tree= HTML::TreeBuilder::XPath->new;
$tree->parse_file("a6.html");
my @pageString = $tree->findvalues('//p/strong');
print @pageString;
[root@node01 jquery]# perl a6.pl
你最喜欢的水果是?[root@node01 jquery]#