simple html dom scraping large html file

有些话、适合烂在心里 提交于 2019-11-30 05:16:32

问题


I need to scrape a large html file (eg: http://www.indianrail.gov.in/mail_express_trn_list.html) using simple html dom. I started with a simple script:

<?php
require "simple_html_dom.php";
echo file_get_html('http://www.indianrail.gov.in/mail_express_trn_list.html')->plaintext;
?>

which shows nothing, just a blank page with the error message in Apache error.log file

 PHP Notice:  Trying to get property of non-object in /var/www/index.php on line 3
 PHP Notice:  Trying to get property of non-object in /var/www/index.php on line 3

at the same time all other pages (eg: http://www.indianrail.gov.in/special_trn_list.html) works fine with the same script.


回答1:


The issue appears to be MAX_FILE_SIZE defined in simple_html_dom.

you can adjust it by editing define('MAX_FILE_SIZE', 600000); line in simple_html_dom.php file.



来源:https://stackoverflow.com/questions/17939101/simple-html-dom-scraping-large-html-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!