嗨,我有简单的HTML DOM代码问题,它表明这个错误: -PHP - 未能打开流:没有这样的主机被称为
的file_get_contents(http://www.arakne-links.com) [function.file-GET-内容]:未能打开流: php_network_getaddresses:getaddrinfo失败:没有这样的主机是已知的。 在d:\ XAMPP \ htdocs中\上线75
,因为这个网址http://www.arakne-links.c现在没有工作,我想
知道有什么办法可跳过网址这是不是报废\ simple_html_dom.php工作..
这里是我使用
ini_set('display_errors', 'on');
include_once('../../simple_html_dom.php');
// create HTML DOM
$htmls = file_get_html('http://info.vilesilencer.com/top');
foreach($htmls->find('a[rel="nofollow"]') as $e):
$test = $e->href;
$url = array($test);
$html = array();
foreach($url as $key=>$value) {
// get html plain-text for webpage & assign to html array.
$html = file_get_html(trim($value));
// echo html plain text:
echo $html->find('title', 0)->innertext;
}
endforeach;
请帮我解决这个问题,它的代码。
Thankyou
您正在使用'file_get_content'函数的地方。 – 2013-05-03 11:57:00
我的事情我修复它,并获得在下一个网址,但现在有新的错误,我更换此代码$ html = file_get_html(trim($ value)); // echo html纯文本: echo $ html-> find('title',0) - > innertext;用$ html = @file_get_html(trim($ value)); if($ html){ echo $ html-> find('title',0) - > innertext; } else { //错误 \t echo'not working'; }但现在它显示一些通知 – Corlax 2013-05-03 11:59:09
你好MIss poo我在这里使用file_get_content echo $ html-> find('title',0) - > innertext;它的一个simple_html_dom.php函数 – Corlax 2013-05-03 12:01:51