我正在尝试在 perl 中进行屏幕抓取,并将其归结为一组表格元素。
字符串:
<tr>
<td>10:11:00</td>
<td><a href="/page/controller/33">712</a></td>
<td>Start</td>
<td>Finish</td>
<td>200</td>
<td>44</td>
代码:
if($item =~ /<td>(.*)?<\/td>/)
{
print "\t$item\n";
print "\t1: $1\n";
print "\t2: $2\n";
print "\t3: $3\n";
print "\t4: $4\n";
print "\t5: $5\n";
print "\t6: $6\n";
}
输出:
1: 10:11:00
2:
3:
4:
5:
6:
我尝试了多种方法,但无法获得预期的结果。想法?