我想列出頁面上的所有鏈接和名稱。我不斷收到銀行的輸出低於返回xpath的空白輸出
$url="http://www.ciim.in/top-pr-dofollow-social-bookmarking-sites-list-2016";
$html = file_get_contents($url);
代碼和節點部分
$nodes = $my_xpath->query('//table[@class="social_list"]/tbody/tr');
foreach($nodes as $node)
{
$title = $my_xpath->evaluate('td[1]/a"]', $node);
$link = $my_xpath->evaluate('td[1]/a/@href"]', $node);
echo $title.",".$link."<br>";
}
筆記右鍵點擊該網站上被禁用,我使用的開發工具來檢查代碼中鉻元素
不錯的見解! +1 – splash58
工作...真棒! –