Noob Question about html

Discussion in 'Perl' started by no one, Jun 9, 2006.

  1. no one

    no one Guest

    Hi,

    I want to write a pearl script that will go out to a web
    site and download the page. Then pull certain value pairs
    out of it. Basically I want to see graphs of snr etc.

    Is grabbing the html possible in perl? I know the parsing
    is. Basically I want to see if any of the values change and
    it corresponds to cable outages.


    example web page to parse
    =================================
    <html>
    <head>
    <title>Thomson Cable Modem Diagnostics</title>
    <META HTTP-EQUIV="Refresh" CONTENT="5">
    </head>
    <body link="#FFFFFF" vlink="#FFFFFF" alink="#000000"
    bgcolor="#7686B6">

    <table border="0" cellpadding="0" cellspacing="0" width="500">
    <tr>
    <td width="134" height="58" bgcolor="#394a84"
    align="center"><img src="images/thomson.gif" width="103"
    height="34"></td>
    <td width="506" height="58" bgcolor="#394a84"
    colspan="4"><font face="Arial"
    color="#ffffff"><big><big>&nbsp; Modem Technical Details
    Status Page</big></big><br> <small>&nbsp;&nbsp;&nbsp; This
    page will auto-refresh periodically.</small></font></td>
    </tr>
    <tr>
    <td width="134" height="108" bgcolor="#394a84"
    rowspan="4"><img src="images/space.gif" width="134"
    height="9"><br> <font color="#FFFFFF"
    face="Arial"><small><small>&nbsp; Status
    Code:&nbsp;&nbsp;</small></small><br>
    <small><small>&nbsp;&nbsp;Operational </small></small><br>
    <small><small>&nbsp; Software Version:<br> &nbsp;&nbsp;
    ST.23.16.50 <br> &nbsp; Software Model:<br> &nbsp;&nbsp;
    0719 <br> &nbsp; Bootloader:<br> &nbsp;&nbsp;
    04.01</small></small></font></td>
    <td width="506" height="18" colspan="4"><img
    src="images/topcorner.gif" width="506" height="9"><br>
    <small><font
    face="Arial"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    Cable Signal Details</strong> </font></small></td>
    </tr>
    <tr>
    <td width="18" height="90"
    rowspan="3">&nbsp;&nbsp;&nbsp; </td>
    <td width="290" height="9" bgcolor="#FFFFFF"><img
    src="images/top1.gif" width="290" height="9"></td>
    <td width="180" height="9" bgcolor="#FFFFFF"><img
    src="images/top2.gif" width="180" height="9"></td>
    <td width="18" height="90" rowspan="3">&nbsp; </td>
    </tr>
    <tr>
    <td width="290" bgcolor="#FFFFFF"><font
    face="Arial"><small><strong>&nbsp;&nbsp; Forward
    Path:</strong><br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Signal Acquired
    at 729.025 MHz <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SNR: 36.1 dB<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Received Signal
    Strength: -0.3 dBmV <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    Micro-Reflections: 22 dBc <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Modulation: 256
    QAM </small><br> <big><big>&nbsp; </big></big></font></td>
    <td width="180" bgcolor="#FFFFFF"><font
    face="Arial"><small><strong>Return Path:</strong><br>
    &nbsp;&nbsp;&nbsp;&nbsp; Connection: Acquired <br>
    &nbsp;&nbsp;&nbsp;&nbsp; Frequency: 37 MHz <br>
    &nbsp;&nbsp;&nbsp;&nbsp; Power Level: 46.2 dBmV <br>
    &nbsp;&nbsp;&nbsp;&nbsp; Channel ID: 4 <br>
    &nbsp;&nbsp;&nbsp;&nbsp; Modulation: 16 QAM</small><br>
    <big><big>&nbsp; </big></big></font></td>
    </tr>
    <tr>
    <td width="290" height="9" bgcolor="#FFFFFF"><img
    src="images/bot1.gif" width="290" height="9"></td>
    <td width="180" height="9" bgcolor="#FFFFFF"><img
    src="images/bot2.gif" width="180" height="9"></td>
    </tr>
    <tr>
    <td width="134" height="18"
    bgcolor="#394a84"><small><font color="#000000"
    face="Arial"><small>&nbsp; <a href="diagnostics.htm">Back to
    Diagnostics</a></small></font></small></td>
    <td width="506" height="18"
    colspan="4"><small><strong><font
    face="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Data
    Service Details</font></strong></small></td>
    </tr>
    <tr>
    <td width="134" height="90" bgcolor="#394a84"
    rowspan="3"></td>
    <td width="18" height="90"
    rowspan="3">&nbsp;&nbsp;&nbsp; </td>
    <td width="470" height="9" bgcolor="#FFFFFF"
    colspan="2"><img src="images/top.gif" width="470"
    height="9"></td>
    <td width="18" height="90" rowspan="3">&nbsp; </td>
    </tr>
    <tr>
    <td width="470" bgcolor="#FFFFFF"
    colspan="2">&nbsp;&nbsp;<font face="Arial"><small>&nbsp;
    Provisioned Address: Yes<br> &nbsp;&nbsp;&nbsp; Provisioned
    Time: Yes<br> &nbsp;&nbsp;&nbsp; Provisioned Configuration:
    Yes<br> &nbsp;&nbsp;&nbsp; Registered: Yes<br>
    &nbsp;&nbsp;&nbsp; BPI: Enabled</small><br> <big>&nbsp;
    </big></font></td>
    </tr>
    <tr>
    <td width="470" height="9" bgcolor="#FFFFFF"
    colspan="2"><img src="images/bot.gif" width="470"
    height="9"></td>
    </tr>
    <tr>
    <td width="134" height="52"><img
    src="images/botcorner.gif" width="134" height="52"></td>
    <td width="506" height="52" colspan="4"></td>
    </tr>

    </table>
    </body>
    </html>

    =================================
    no one, Jun 9, 2006
    #1
    1. Advertising

  2. no one

    Jim Gibson Guest

    In article <>, no one
    <> wrote:

    > Hi,
    >
    > I want to write a pearl script that will go out to a web
    > site and download the page. Then pull certain value pairs
    > out of it. Basically I want to see graphs of snr etc.
    >
    > Is grabbing the html possible in perl? I know the parsing
    > is. Basically I want to see if any of the values change and
    > it corresponds to cable outages.


    See the Perl FAQ entries "How do I fetch an HTML file?" and "How do I
    remove HTML from a string?".

    If you have Perl installed:

    perldoc -q HTML

    FYI: this newsgroup is defunct; use comp.lang.perl.misc in the future.
    Jim Gibson, Jun 9, 2006
    #2
    1. Advertising

  3. no one wrote:
    > Is grabbing the html possible in perl?


    You could do it exactly the way it is described in the FAQ:
    "How do I fetch an HTML file?"

    > I know the parsing is.


    True, but I hope you intend to do it the right way and not by using some
    "smart" use of REs? See FAQ
    "How do I remove HTML from a string?"
    for a few examples of why contrary to popular believe parsing HTML is not
    trivial.

    jue
    Jürgen Exner, Jun 9, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ToChina

    Noob question about returning HTML

    ToChina, Jun 8, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    331
    ToChina
    Jun 8, 2005
  2. (Pete Cresswell)
    Replies:
    17
    Views:
    742
    Jeffrey Silverman
    Dec 15, 2004
  3. Kenneth Tilton
    Replies:
    4
    Views:
    543
  4. Michael Lesser

    Noob, html trees & parsing

    Michael Lesser, Jun 12, 2009, in forum: Ruby
    Replies:
    1
    Views:
    141
    Sanjay Sharma
    Jun 13, 2009
  5. Morten Guldager
    Replies:
    0
    Views:
    111
    Morten Guldager
    Dec 30, 2012
Loading...

Share This Page