2013-07-30 28 views
5

我需要使用簡單的HTML DOM來廢棄一個大的HTML文件(例如: - http://www.indianrail.gov.in/mail_express_trn_list.html)。我開始用一個簡單的腳本..簡單的HTML DOM廢除大型HTML文件

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

這表明了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 

沒什麼,只是與該錯誤消息的空白頁,同時所有其他頁面(例如: - http://www.indianrail.gov.in/special_trn_list.html)使用相同的腳本正常工作。 需要幫助

在此先感謝。

+0

您是否嘗試過使用'file_get_contents'而不是'file_get_html'? http://php.net/manual/en/function.file-get-contents.php –

+0

我能夠複製的問題,我會深入挖掘,讓你知道 – DevZer0

+0

@Fred我試過了,但同樣的錯誤.. – krizna

回答

12

該問題似乎是simple_html_dom中定義的MAX_FILE_SIZE

您可以通過在simple_html_dom.php文件中編輯define('MAX_FILE_SIZE', 600000);行來調整它。

+0

我試過define('MAX_FILE_SIZE',6000000000000000000); ..但沒有運氣..仍然是相同的錯誤..謝謝 – krizna

+4

定義一個現實的數字,我把它設置爲12600000 – DevZer0

+0

它接縫工作,但我現在得到不同的錯誤..退出信號分段錯誤(11) – krizna