use LWP::Simple;
my @M = split(/\n/,get 'http://www.cwb.gov.tw/V5/forecast/taiwan/week.htm' );
foreach (@M)
{
next if (!/^<t/);
print "\n" if (/^<tr/ || /^<table/);
print "\t" if (/<\/th>/);
print "\t\t$1" if (/title="(.*)">.*<\/td>/);
s/<[^>]*>//g;
s/\(.*\)//g;
print;
}
#你要的資訊都拿出來了,只是排版怪怪的
#你自己再去增減\t吧
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.120.15.17
討論串 (同標題文章)
完整討論串 (本文為第 3 之 3 篇):