Noob Question about html

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • no one

    Noob Question about html


    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>Thomso n Cable Modem Diagnostics</title>
    <META HTTP-EQUIV="Refresh" CONTENT="5">
    </head>
    <body link="#FFFFFF" vlink="#FFFFFF" alink="#000000"
    bgcolor="#7686B 6">

    <table border="0" cellpadding="0" cellspacing="0" width="500">
    <tr>
    <td width="134" height="58" bgcolor="#394a8 4"
    align="center"> <img src="images/thomson.gif" width="103"
    height="34"></td>
    <td width="506" height="58" bgcolor="#394a8 4"
    colspan="4"><fo nt face="Arial"
    color="#ffffff" ><big><big>&nbs p; Modem Technical Details
    Status Page</big></big><br> <small>&nbsp;&n bsp;&nbsp; This
    page will auto-refresh periodically.</small></font></td>
    </tr>
    <tr>
    <td width="134" height="108" bgcolor="#394a8 4"
    rowspan="4"><im g src="images/space.gif" width="134"
    height="9"><br> <font color="#FFFFFF"
    face="Arial"><s mall><small>&nb sp; Status
    Code:&nbsp;&nbs p;</small></small><br>
    <small><small>& nbsp;&nbsp;Oper ational </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"><im g
    src="images/topcorner.gif" width="506" height="9"><br>
    <small><font
    face="Arial"><s trong>&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;
    Cable Signal Details</strong> </font></small></td>
    </tr>
    <tr>
    <td width="18" height="90"
    rowspan="3">&nb sp;&nbsp;&nbsp; </td>
    <td width="290" height="9" bgcolor="#FFFFF F"><img
    src="images/top1.gif" width="290" height="9"></td>
    <td width="180" height="9" bgcolor="#FFFFF F"><img
    src="images/top2.gif" width="180" height="9"></td>
    <td width="18" height="90" rowspan="3">&nb sp; </td>
    </tr>
    <tr>
    <td width="290" bgcolor="#FFFFF F"><font
    face="Arial"><s mall><strong>&n bsp;&nbsp; Forward
    Path:</strong><br>
    &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp; Signal Acquired
    at 729.025 MHz <br>
    &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp; SNR: 36.1 dB<br>
    &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp; Received Signal
    Strength: -0.3 dBmV <br>
    &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;
    Micro-Reflections: 22 dBc <br>
    &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp; Modulation: 256
    QAM </small><br> <big><big>&nbsp ; </big></big></font></td>
    <td width="180" bgcolor="#FFFFF F"><font
    face="Arial"><s mall><strong>Re turn Path:</strong><br>
    &nbsp;&nbsp;&nb sp;&nbsp; Connection: Acquired <br>
    &nbsp;&nbsp;&nb sp;&nbsp; Frequency: 37 MHz <br>
    &nbsp;&nbsp;&nb sp;&nbsp; Power Level: 46.2 dBmV <br>
    &nbsp;&nbsp;&nb sp;&nbsp; Channel ID: 4 <br>
    &nbsp;&nbsp;&nb sp;&nbsp; Modulation: 16 QAM</small><br>
    <big><big>&nbsp ; </big></big></font></td>
    </tr>
    <tr>
    <td width="290" height="9" bgcolor="#FFFFF F"><img
    src="images/bot1.gif" width="290" height="9"></td>
    <td width="180" height="9" bgcolor="#FFFFF F"><img
    src="images/bot2.gif" width="180" height="9"></td>
    </tr>
    <tr>
    <td width="134" height="18"
    bgcolor="#394a8 4"><small><f ont color="#000000"
    face="Arial"><s mall>&nbsp; <a href="diagnosti cs.htm">Back to
    Diagnostics</a></small></font></small></td>
    <td width="506" height="18"
    colspan="4"><sm all><strong><fo nt
    face="Arial">&n bsp;&nbsp;&nbsp ;&nbsp;&nbsp;&n bsp; Data
    Service Details</font></strong></small></td>
    </tr>
    <tr>
    <td width="134" height="90" bgcolor="#394a8 4"
    rowspan="3"></td>
    <td width="18" height="90"
    rowspan="3">&nb sp;&nbsp;&nbsp; </td>
    <td width="470" height="9" bgcolor="#FFFFF F"
    colspan="2"><im g src="images/top.gif" width="470"
    height="9"></td>
    <td width="18" height="90" rowspan="3">&nb sp; </td>
    </tr>
    <tr>
    <td width="470" bgcolor="#FFFFF F"
    colspan="2">&nb sp;&nbsp;<font face="Arial"><s mall>&nbsp;
    Provisioned Address: Yes<br> &nbsp;&nbsp;&nb sp; Provisioned
    Time: Yes<br> &nbsp;&nbsp;&nb sp; Provisioned Configuration:
    Yes<br> &nbsp;&nbsp;&nb sp; Registered: Yes<br>
    &nbsp;&nbsp;&nb sp; BPI: Enabled</small><br> <big>&nbsp;
    </big></font></td>
    </tr>
    <tr>
    <td width="470" height="9" bgcolor="#FFFFF F"
    colspan="2"><im g src="images/bot.gif" width="470"
    height="9"></td>
    </tr>
    <tr>
    <td width="134" height="52"><im g
    src="images/botcorner.gif" width="134" height="52"></td>
    <td width="506" height="52" colspan="4"></td>
    </tr>

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

    =============== =============== ===
  • Jim Gibson

    #2
    Re: Noob Question about html

    In article <0tmdnavb98urKh XZnZ2dnUVZ_uqdn Z2d@comcast.com >, no one
    <noBody@NoWhere .Com> wrote:
    [color=blue]
    > 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.[/color]

    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.

    Comment

    • Jürgen Exner

      #3
      Re: Noob Question about html

      no one wrote:[color=blue]
      > Is grabbing the html possible in perl?[/color]

      You could do it exactly the way it is described in the FAQ:
      "How do I fetch an HTML file?"
      [color=blue]
      > I know the parsing is.[/color]

      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


      Comment

      Working...