I am having some difficulty in parsing an HTML file.
Here is the part of the HTML file I want to extract the name of the website :
<span class="bold1">Name: </span>www.google.com<br />
<span class="bold1">Name: </span>www.facebook.com<br />
<span class="bold1">Name: </span>www.myspace.com<br />
Here is the Perl code snippet using HTML::TreeBuilder module
my @style = $root->look_down('class' => qr/bold1$/);
How do we extract the next element here : I would like to extract from the above example :
for (@style) { my $title1 = $_->as_HTML; #text print " title" . $title . "\n"; }
Thanks
Use the
right()method.