Connecting Tech Pros Worldwide Help | Site Map

Noob Question about html

  #1  
Old June 9th, 2006, 12:45 AM
no one
Guest
 
Posts: n/a

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>

=================================
  #2  
Old June 9th, 2006, 01:45 AM
Jim Gibson
Guest
 
Posts: n/a

re: Noob Question about html


In article <0tmdnavb98urKhXZnZ2dnUVZ_uqdnZ2d@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.
  #3  
Old June 9th, 2006, 04:05 AM
Jürgen Exner
Guest
 
Posts: n/a

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


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
variables and pointers.. noob question.. streamkid@gmail.com answers 14 October 20th, 2006 08:25 PM
Noob question about parsing a BSTR joseph_mueller@yahoo.com answers 4 May 11th, 2006 08:25 PM
Noob question about returning HTML ToChina answers 2 November 19th, 2005 02:03 PM
High-level question about ASP.NET web controls.. RCS answers 1 November 17th, 2005 12:08 AM