Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Regex not working

by imrags (Monk)
on Jul 17, 2009 at 10:10 UTC ( #780998=note: print w/ replies, xml ) Need Help??


in reply to Regex not working

Thank you everyone, the /s was the problem, i had not put it...that prevented the regex from working
Also, I am planning to use HTML::TreeBuilder...to get the table.

<table border='1' width='50%' align='center'><tr><td><strong>Customer< +/td><td><strong>Total Samples</td><td><s trong>SL Violations</td><td><strong>Avg Availability</td></tr><tr><td> All Customers</td><td>187556</td><td>2167</td><td>98.84</td> </td></tr></table> <br><p><strong><h2><center>Customers Below 90% Available</center></h2> +</p><table border='1' width='50%' align= 'center'><tr><td><strong>Customer</td><td><strong>Total Samples</td><t +d><strong>SL Violations</td><td><strong> Availability</td></tr> <tr><td>10P</td><td>1064</td><td>130</td><td>87.78 %</td></tr> <tr><td>B8S</td><td>326</td><td>34</td><td>89.57 %</td></tr> </tr></table>
I'm trying to get individual values from the table and then convert to pdf...
Would HTML::TreeBuilder be a good choice to fetch data?
Raghu


Comment on Re: Regex not working
Download Code
Re^2: Regex not working
by grinder (Bishop) on Jul 17, 2009 at 12:03 UTC
    I'm trying to get individual values from the table and then convert to pdf... Would HTML::TreeBuilder be a good choice to fetch data?

    I've minimal experience with it, mainly because each time I pick it up, I've found the interface cumbersome, and unwieldy to use. And it's pretty slow, relatively speaking, although I don't consider that to be an important point.

    I find HTML::Parser much easier to use (although you have to invest some time in learning how to use it). If you install it via a package, do yourself a favour and track down the examples directory that is bundled with the distribution. You will probably find an example that you can adapt to the problem at hand.

    It's a complex tool that's worthwhile mastering if you have to grovel around in HTML files.

    • another intruder with the mooring in the heart of the Perl

      Hi Raghu,

      Since, you are evaluating different perl modules to parse HTML files, you can take a look at HTML::TokeParser. It is an alternative HTML::Parser interface. I have used it and found it pretty helpful.

      - Prantik

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://780998]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2014-09-21 01:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (165 votes), past polls