我有這個html: <h2><a href="http://.... > title</h2>
我怎樣才能得到字符串「href」?php DOM內部標籤(simple_html_dom)
include('simple_html_dom.php');
$html = file_get_html('http://...');
foreach($html->find('h2')->find('a') as $k) {
echo $k->href . '<br>';
}
錯誤:
我試圖調用一個成員函數查找()一個非對象
只是嘗試刪除第一個「H2」找到creteria並適用於所有「一'是$ html-> find('a')..我認爲它會工作.. – 2011-12-31 18:38:04