我想用一个网站的内容,包括它们与"Simple Html DOM"矿,可惜这通常适用于另一个网站的代码,无法在这种特殊情况下:简单的HTML DOM不工作的表[类]
<?php
// Note you must download the php files from the link above
// and link to them on this line below.
include_once('simple_html_dom.php');
$html = file_get_html('http://www.comelmar.it/index.aspx?idmnu=23&midx=3&mbidx=2&idmnub=8&Lang=EN');
$elem = $html->find('table[class=Descrizione]', 0);
echo $elem;
?>
Warning: file_get_contents(http://www.comelmar.it/index.aspx?idmnu=23&midx=3&mbidx=2&idmnub=8&Lang=EN) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in public_html/elin-custom-code/simple_html_dom.php on line 75
Fatal error: Call to a member function find() on a non-object in public_html/elin-custom-code/sklad-1.php on line 9
它看起来像页面需要用户代理或其他东西。它投掷500意味着有错误。你的'致命错误'是因为'$ html'是错误的。 – chris85