使用Simplehtmldom,我如何访问"文件号"的值? &安培; "网站地址"在下面的行中,将它们分配给变量。我尝试了尽可能多的方法,但似乎无法破解它。任何帮助都将受到赞赏。 提前致谢
<table summary="Results of the Search" class="display_table"
cellspacing="2" cellpadding="4">
<tbody>
<tr class="Row1">
<td title="View Application Details" class="TableData">
<a class="data_text" href="StdDetails.aspx?PT=Planning Applications On-Line&TYPE=PL/PlanningPK.xml&PARAM0=
606013&XSLT=
/Northgate/PlanningExplorer/SiteFiles/Skins/EppingForest/xslt/PL/PLDetails.xslt&FT=Planning Application Details&PUBLIC=
Y&XMLSIDE=/Northgate/PlanningExplorer/SiteFiles/Skins/EppingForest/Menus/PL.xml&DAURI=PLANNING
">EPF/0480/18/NEW</a>
</td>
<td class="data_text" title="File Number">018049</td>
<td class="data_text" title="Site Address">Hoggs Farm
Carters Green Road
Matching
Harlow
CM17 0NX</td>
<td class="data_text" title="Development Description">Grade II listed building application for proposed extension</td>
<td class="data_text" title="Status">NEW</td>
<td class="data_text" title="Date Registered">--</td>
<td class="data_text" title="Decision"></td>
</tr>
$output = curl_exec($ch);
$html = str_get_html($output);
$display_rows = $html->find('table[class=display_table]',0)->find('tr');
if(count($display_rows)>0)
foreach($display_rows as $row)
{
$tds = $row->find('td');
if(count($tds)==0)
continue;
$data = array();
foreach($tds as $td)
{
if($td->title=="File Number")
{
$filenumbertd = $td->children(1);
$filenumber= $filenumbertd;
echo $filenumber.'<br>';
}
}
}
planning_scrape( 1 );
?>
</body>
</html>