Kaustubh has asked for the wisdom of the Perl Monks concerning the following question:
My programming experience with perl is just 2 weeks.I am stuck with a problem.I need to get the value $8.39 from the following code snippet.This code snippet is obtained by selecting the view source option when we right click a web browser:-
I am using the mechanize package.I have tried various permutations and combinations of find() & attr() methods.Basically whatever I have tried is throwing errors:-<span class="details-title-text"> <strong>$8.39</strong> </span>
foreach my $b ($mech->find('span')) { my $attr_class= $b->attr('class'); if(defined($attr_class) ) { my $tag_strong=$mech->find('strong'); print Dumper($tag_strong); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Extracting Tag and attributes from a Web Page
by marto (Cardinal) on Jul 26, 2016 at 12:51 UTC | |
by Kaustubh (Acolyte) on Jul 27, 2016 at 04:44 UTC | |
|
Re: Extracting Tag and attributes from a Web Page
by marto (Cardinal) on Jul 27, 2016 at 07:43 UTC | |
by Kaustubh (Acolyte) on Jul 27, 2016 at 10:34 UTC | |
by marto (Cardinal) on Jul 27, 2016 at 10:35 UTC |