私はperlに非常に慣れていないので、Webページからテーブルを抽出するのに助けが必要です。今日、perlでページを印刷する方法を理解することができました。ここで、温度を示すテーブルの情報を抽出するだけで済みます。私の現在のコードは次のとおりです。
# perl
use strict;
# use LWP::Simple;
use LWP::UserAgent;
my $ua = new LWP::UserAgent;
$ua->timeout(120);
my $url='http://MyTempSite/';
my $request = new HTTP::Request('GET', $url);
my $response = $ua->request($request);
my $content = $response->content();
print $content;
私はこのhtmlファイルから温度の読みを取得しようとしています:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><body bgcolor="#C0C0C0" text="#000000" vlink="#800080" link="#0000FF"><P><h1>TempTrax Digital Thermometer</h1><BR><table cellpadding=0 cellspacing=0 border=0><TR><TD>Model:</TD><TD width=10 rowspan=7><BR></TD><TD>E4</TD><TR><TD>Manufacturer:</TD><TD>Sensatronics</TD> </TR><TR><TD>Website:</TD><TD><a href="http://www.sensatronics.com">http://www.sensatronics.com</a></TD></TR><TR><TD>Firmware Version:</TD><TD>1.2</TD></TR><TR><TD>Release Date:</TD><TD>December 16, 2003</TD></TR><TR><TD>Serial Number:</TD><TD>EA8E6L0T121</TD></TR><TR><TD>Unit name:</TD><TD>LiveTempMonitor</TD></TR></TABLE><P><h3>Current temperature readings:</h3><p><table><TR><TD width=200>Probe1:</TD><TD> 75.1</TD></TR>
<TR><TD width=200>Probe2:</TD><TD>-99.9</TD></TR>
<TR><TD width=200>Probe3:</TD><TD>-99.9</TD></TR>
<TR><TD width=200>Probe4:</TD><TD>-99.9</TD></TR>
</table></body></html>
「現在の温度測定値」テーブルの情報のみを取得するにはどうすればよいですか?よろしくお願いします。