Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The tag contents I am looking for look like this: <td> ## </td> where ## is either a single or two digit number. However, there are lots of td tags in the page that contain numbers with decimals points but without the nbsp tag. ie. <td>5.4</td>. I tried to screen the tags using the nbsp tag but that didn't work.elsif( ($tag eq "td") ) { my $text = $tp->get_text; print "$text\n" if($text =~ /\d{1,2}/); }
Any ideas why not? Is there any way to write the if statement above to screen for just a single or two digit number or to somehow exclude text that contains decimal points? Thanks.if($text =~ /nbsp/);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: TokeParser
by LTjake (Prior) on Oct 26, 2002 at 19:58 UTC | |
by Aristotle (Chancellor) on Oct 26, 2002 at 22:03 UTC | |
|
Re: TokeParser
by BrowserUk (Patriarch) on Oct 26, 2002 at 19:33 UTC | |
|
Re: TokeParser
by graff (Chancellor) on Oct 27, 2002 at 04:55 UTC | |
|
Re: TokeParser
by PodMaster (Abbot) on Oct 27, 2002 at 08:41 UTC | |
by BrowserUk (Patriarch) on Oct 27, 2002 at 09:17 UTC | |
by strider corinth (Friar) on Oct 28, 2002 at 05:24 UTC |