小编kri*_*zna的帖子

简单的html dom刮大html文件

我需要使用简单的html dom 刮一个大的html文件(例如:http://www.indianrail.gov.in/mail_express_trn_list.html).我从一个简单的脚本开始:

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

它没有显示任何内容,只是一个空白页面,其中包含Apache error.log文件中的错误消息

 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
Run Code Online (Sandbox Code Playgroud)

同时所有其他页面(例如:http://www.indianrail.gov.in/special_trn_list.html)使用相同的脚本正常工作.

html php parsing dom file-get-contents

6
推荐指数
1
解决办法
4623
查看次数

标签 统计

dom ×1

file-get-contents ×1

html ×1

parsing ×1

php ×1