Go Back   Velocity Reviews > Newsgroups > PERL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

PERL - Noob Question about html

 
Thread Tools Search this Thread
Old 06-09-2006, 12:48 AM   #1
Default 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>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
  Reply With Quote
Old 06-09-2006, 01:44 AM   #2
Jim Gibson
 
Posts: n/a
Default Re: Noob Question about html

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.
  Reply With Quote
Old 06-09-2006, 04:04 AM   #3
Jürgen Exner
 
Posts: n/a
Default Re: Noob Question about html

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


  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump