我剛剛嘗試使用簡單HTML DOM框架進行抓取:http://simplehtmldom.sourceforge.net/,但出於安全原因,服務器配置中禁用了file_get_contents
。是否有(PHP)Web Scraping框架使用Curl而不是file_get_contents?
我現在需要找到一個類似的使用Curl的框架 - 任何人都知道什麼?
錯誤消息試圖運行點例如斜線時,我得到的是:
Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /var/www/vhosts/domain.com/httpdocs/crawlfeed/simple_html_dom.php on line 70
[如何解析和處理HTML與PHP?](http://stackoverflow.com/questions/3577641/how-to-parse-and-process-html-with-php) – mario 2012-01-13 16:02:15
不能你只是cURL文件,然後將文本字符串加載到SimpleHTMLDOM中? – prodigitalson 2012-01-13 16:02:27
你不必在simplehtml中使用file_get_contents。您可以使用curl自己獲取html,並直接將結果提供給simplehtml。 – 2012-01-13 16:02:33