嗨,我有簡單的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