【发布时间】:2012-06-27 16:43:56
【问题描述】:
我有我要传递给函数 doScrape() 的网站列表,此函数创建 SimpleHtmlDom 对象并加载作为参数传递给它的 url。
但是当 scraper 正在进行时,无法加载一个 url,PHP 会抛出以下异常
警告:file_get_contents(http://www.somesite.com) [function.file-get-contents]:打开流失败:HTTP 请求失败!第 850 行 F:\xampp\htdocs\scraping\scraper\simple_html_dom.php 中的 HTTP/1.0 500 内部服务器错误
由于这个错误,整个 scraper 停止工作。如何处理此异常并保持 scraper 运行事件有错误。
【问题讨论】:
标签: simple-html-dom