Php 简单HTMLDOM404错误
嘿,伙计们,我有这个密码:Php 简单HTMLDOM404错误,php,web-crawler,simple-html-dom,Php,Web Crawler,Simple Html Dom,嘿,伙计们,我有这个密码: <?php include './simple_html_dom.php'; //this link exists $teste = new simple_html_dom("http://www.btolinux.com.br/"); echo $teste->original_size."<br>"; if($teste->original_size !== 0){ $teste->find("html"); }
<?php
include './simple_html_dom.php';
//this link exists
$teste = new simple_html_dom("http://www.btolinux.com.br/");
echo $teste->original_size."<br>";
if($teste->original_size !== 0){
$teste->find("html");
}
//At this time I'm forcing get a 404 error link.
$teste = new simple_html_dom("http://www.btolinux.com.br/error/");
echo $teste->original_size."<br>";
if($teste->original_size !== 0){
$teste->find("html");
}
//Now I'm get the correct link again. Why the error persists?
$teste = new simple_html_dom("http://www.btolinux.com.br/");
echo $teste->original_size."<br>";
if($teste->original_size !== 0){
$teste->find("html");
}
?>
<?php
require_once("./simple_html_dom.php"); # simplehtmldom.sourceforge.net
$url="http://www.btolinux.com.br/";
$url404="http://www.btolinux.com.br/error/";
$teste = @file_get_html($url);
if ($teste && $teste->original_size) {
echo $teste->original_size."<br>\n";
$html = $teste->find("html");
}
$teste = @file_get_html($url404);
if ($teste && $teste->original_size) {
echo $teste->original_size."<br>\n";
$html = $teste->find("html");
}
$teste = @file_get_html($url);
if ($teste && $teste->original_size) {
echo $teste->original_size."<br>\n";
$html = $teste->find("html");
}
?>
您是否尝试过先使用file\u get\u contents()文件?
例如,如果使用以下代码:
<?php
print_r(file_get_contents("http://www.btolinux.com.br/error/"));
?>
您将看到有一个错误,然后可以尝试捕获它。您是否尝试过先使用file\u get\u contents()呢?
例如,如果使用以下代码:
<?php
print_r(file_get_contents("http://www.btolinux.com.br/error/"));
?>
您将看到有一个错误,然后可以尝试捕获它。您是否尝试过先使用file\u get\u contents()呢?
例如,如果使用以下代码:
<?php
print_r(file_get_contents("http://www.btolinux.com.br/error/"));
?>
您将看到有一个错误,然后可以尝试捕获它。您是否尝试过先使用file\u get\u contents()呢?
例如,如果使用以下代码:
<?php
print_r(file_get_contents("http://www.btolinux.com.br/error/"));
?>
您将看到有一个错误,然后您可以尝试捕捉它。建议:
$teste = new simple_html_dom();
$teste->load_file("http://www.btolinux.com.br/");
...
。。。或者
$teste = file_get_html("http://www.btolinux.com.br/");
建议:
$teste = new simple_html_dom();
$teste->load_file("http://www.btolinux.com.br/");
...
。。。或者
$teste = file_get_html("http://www.btolinux.com.br/");
建议:
$teste = new simple_html_dom();
$teste->load_file("http://www.btolinux.com.br/");
...
。。。或者
$teste = file_get_html("http://www.btolinux.com.br/");
建议:
$teste = new simple_html_dom();
$teste->load_file("http://www.btolinux.com.br/");
...
。。。或者
$teste = file_get_html("http://www.btolinux.com.br/");
请尝试使用@以避免出现如下警告:
<?php
//CORRECT
$url = "http://www.btolinux.com.br/";
$html = @file_get_contents($url);
if ($html!='') {
$teste = new simple_html_dom($url);
echo 'SIZE: '.$teste->original_size."<br>";
}
//ERROR
$url = "http://www.btolinux.com.br/error/";
$html = @file_get_contents($url);
if ($html!='') {
$teste = new simple_html_dom($url);
echo 'SIZE: '.$teste->original_size."<br>";
}
?>
尝试@以避免警告,如下所示:
<?php
//CORRECT
$url = "http://www.btolinux.com.br/";
$html = @file_get_contents($url);
if ($html!='') {
$teste = new simple_html_dom($url);
echo 'SIZE: '.$teste->original_size."<br>";
}
//ERROR
$url = "http://www.btolinux.com.br/error/";
$html = @file_get_contents($url);
if ($html!='') {
$teste = new simple_html_dom($url);
echo 'SIZE: '.$teste->original_size."<br>";
}
?>
尝试@以避免警告,如下所示:
<?php
//CORRECT
$url = "http://www.btolinux.com.br/";
$html = @file_get_contents($url);
if ($html!='') {
$teste = new simple_html_dom($url);
echo 'SIZE: '.$teste->original_size."<br>";
}
//ERROR
$url = "http://www.btolinux.com.br/error/";
$html = @file_get_contents($url);
if ($html!='') {
$teste = new simple_html_dom($url);
echo 'SIZE: '.$teste->original_size."<br>";
}
?>
尝试@以避免警告,如下所示:
<?php
//CORRECT
$url = "http://www.btolinux.com.br/";
$html = @file_get_contents($url);
if ($html!='') {
$teste = new simple_html_dom($url);
echo 'SIZE: '.$teste->original_size."<br>";
}
//ERROR
$url = "http://www.btolinux.com.br/error/";
$html = @file_get_contents($url);
if ($html!='') {
$teste = new simple_html_dom($url);
echo 'SIZE: '.$teste->original_size."<br>";
}
?>
尝试以下代码:
<?php
include './simple_html_dom.php';
//this link exists
$teste = new simple_html_dom("http://www.btolinux.com.br/");
echo $teste->original_size."<br>";
if($teste->original_size !== 0){
$teste->find("html");
}
//At this time I'm forcing get a 404 error link.
$teste = new simple_html_dom("http://www.btolinux.com.br/error/");
echo $teste->original_size."<br>";
if($teste->original_size !== 0){
$teste->find("html");
}
//Now I'm get the correct link again. Why the error persists?
$teste = new simple_html_dom("http://www.btolinux.com.br/");
echo $teste->original_size."<br>";
if($teste->original_size !== 0){
$teste->find("html");
}
?>
<?php
require_once("./simple_html_dom.php"); # simplehtmldom.sourceforge.net
$url="http://www.btolinux.com.br/";
$url404="http://www.btolinux.com.br/error/";
$teste = @file_get_html($url);
if ($teste && $teste->original_size) {
echo $teste->original_size."<br>\n";
$html = $teste->find("html");
}
$teste = @file_get_html($url404);
if ($teste && $teste->original_size) {
echo $teste->original_size."<br>\n";
$html = $teste->find("html");
}
$teste = @file_get_html($url);
if ($teste && $teste->original_size) {
echo $teste->original_size."<br>\n";
$html = $teste->find("html");
}
?>
我的产出是:
61206<br>
61206<br>
61206
61206
尝试以下代码:
<?php
include './simple_html_dom.php';
//this link exists
$teste = new simple_html_dom("http://www.btolinux.com.br/");
echo $teste->original_size."<br>";
if($teste->original_size !== 0){
$teste->find("html");
}
//At this time I'm forcing get a 404 error link.
$teste = new simple_html_dom("http://www.btolinux.com.br/error/");
echo $teste->original_size."<br>";
if($teste->original_size !== 0){
$teste->find("html");
}
//Now I'm get the correct link again. Why the error persists?
$teste = new simple_html_dom("http://www.btolinux.com.br/");
echo $teste->original_size."<br>";
if($teste->original_size !== 0){
$teste->find("html");
}
?>
<?php
require_once("./simple_html_dom.php"); # simplehtmldom.sourceforge.net
$url="http://www.btolinux.com.br/";
$url404="http://www.btolinux.com.br/error/";
$teste = @file_get_html($url);
if ($teste && $teste->original_size) {
echo $teste->original_size."<br>\n";
$html = $teste->find("html");
}
$teste = @file_get_html($url404);
if ($teste && $teste->original_size) {
echo $teste->original_size."<br>\n";
$html = $teste->find("html");
}
$teste = @file_get_html($url);
if ($teste && $teste->original_size) {
echo $teste->original_size."<br>\n";
$html = $teste->find("html");
}
?>
我的产出是:
61206<br>
61206<br>
61206
61206
尝试以下代码:
<?php
include './simple_html_dom.php';
//this link exists
$teste = new simple_html_dom("http://www.btolinux.com.br/");
echo $teste->original_size."<br>";
if($teste->original_size !== 0){
$teste->find("html");
}
//At this time I'm forcing get a 404 error link.
$teste = new simple_html_dom("http://www.btolinux.com.br/error/");
echo $teste->original_size."<br>";
if($teste->original_size !== 0){
$teste->find("html");
}
//Now I'm get the correct link again. Why the error persists?
$teste = new simple_html_dom("http://www.btolinux.com.br/");
echo $teste->original_size."<br>";
if($teste->original_size !== 0){
$teste->find("html");
}
?>
<?php
require_once("./simple_html_dom.php"); # simplehtmldom.sourceforge.net
$url="http://www.btolinux.com.br/";
$url404="http://www.btolinux.com.br/error/";
$teste = @file_get_html($url);
if ($teste && $teste->original_size) {
echo $teste->original_size."<br>\n";
$html = $teste->find("html");
}
$teste = @file_get_html($url404);
if ($teste && $teste->original_size) {
echo $teste->original_size."<br>\n";
$html = $teste->find("html");
}
$teste = @file_get_html($url);
if ($teste && $teste->original_size) {
echo $teste->original_size."<br>\n";
$html = $teste->find("html");
}
?>
我的产出是:
61206<br>
61206<br>
61206
61206
尝试以下代码:
<?php
include './simple_html_dom.php';
//this link exists
$teste = new simple_html_dom("http://www.btolinux.com.br/");
echo $teste->original_size."<br>";
if($teste->original_size !== 0){
$teste->find("html");
}
//At this time I'm forcing get a 404 error link.
$teste = new simple_html_dom("http://www.btolinux.com.br/error/");
echo $teste->original_size."<br>";
if($teste->original_size !== 0){
$teste->find("html");
}
//Now I'm get the correct link again. Why the error persists?
$teste = new simple_html_dom("http://www.btolinux.com.br/");
echo $teste->original_size."<br>";
if($teste->original_size !== 0){
$teste->find("html");
}
?>
<?php
require_once("./simple_html_dom.php"); # simplehtmldom.sourceforge.net
$url="http://www.btolinux.com.br/";
$url404="http://www.btolinux.com.br/error/";
$teste = @file_get_html($url);
if ($teste && $teste->original_size) {
echo $teste->original_size."<br>\n";
$html = $teste->find("html");
}
$teste = @file_get_html($url404);
if ($teste && $teste->original_size) {
echo $teste->original_size."<br>\n";
$html = $teste->find("html");
}
$teste = @file_get_html($url);
if ($teste && $teste->original_size) {
echo $teste->original_size."<br>\n";
$html = $teste->find("html");
}
?>
我的产出是:
61206<br>
61206<br>
61206
61206
Hi,当我使用此备选方案时,显示此错误消息:Hi,当我使用此备选方案时,显示此错误消息:警告:文件\u get\u contents():无法打开流:HTTP请求失败!第75行的/var/www/html/crawler/simple_html_dom.php中找不到HTTP/1.1 404注意:第18行的/var/www/html/crawler/TestCrawler.php中尝试获取非对象的属性注意:第19行的/var/www/html/crawler/TestCrawler.php中尝试获取非对象的属性致命错误:调用成员函数find()在第20Hi行的/var/www/html/crawler/TestCrawler.php中的非对象上,当我使用此备选方案时,会显示此错误消息:Hi,当我使用此备选方案时,会显示此错误消息:警告:文件\获取\内容():无法打开流:HTTP请求失败!第75行的/var/www/html/crawler/simple_html_dom.php中找不到HTTP/1.1 404注意:第18行的/var/www/html/crawler/TestCrawler.php中尝试获取非对象的属性注意:第19行的/var/www/html/crawler/TestCrawler.php中尝试获取非对象的属性致命错误:调用成员函数find()在第20Hi行的/var/www/html/crawler/TestCrawler.php中的非对象上,当我使用此备选方案时,会显示此错误消息:Hi,当我使用此备选方案时,会显示此错误消息:警告:文件\获取\内容():无法打开流:HTTP请求失败!第75行的/var/www/html/crawler/simple_html_dom.php中找不到HTTP/1.1 404注意:第18行的/var/www/html/crawler/TestCrawler.php中尝试获取非对象的属性注意:第19行的/var/www/html/crawler/TestCrawler.php中尝试获取非对象的属性致命错误:调用成员函数find()在第20Hi行的/var/www/html/crawler/TestCrawler.php中的非对象上,当我使用此备选方案时,会显示此错误消息:Hi,当我使用此备选方案时,会显示此错误消息:警告:文件\获取\内容():无法打开流:HTTP请求失败!第75行的/var/www/html/crawler/simple_html_dom.php中找不到HTTP/1.1 404注意:第18行的/var/www/html/crawler/TestCrawler.php中尝试获取非对象的属性注意:第19行的/var/www/html/crawler/TestCrawler.php中尝试获取非对象的属性致命错误:调用成员函数find()在第20行的/var/www/html/crawler/TestCrawler.php中的非对象上,我已经使用过,但出现以下消息:警告:文件\u get\u contents():无法打开流:HTTP请求失败!第75行的/var/www/html/crawler/simple_html_dom.php中找不到HTTP/1.1 404注意:第18行的/var/www/html/crawler/TestCrawler.php中尝试获取非对象的属性注意:第19行的/var/www/html/crawler/TestCrawler.php中尝试获取非对象的属性致命错误:调用成员函数find()在第20行的/var/www/html/crawler/TestCrawler.php中的非对象上,我已经使用过,但出现以下消息:警告:文件\u get\u contents():无法打开流:HTTP请求失败!第75行的/var/www/html/crawler/simple_html_dom.php中找不到HTTP/1.1 404注意:第18行的/var/www/html/crawler/TestCrawler.php中尝试获取非对象的属性注意:第19行的/var/www/html/crawler/TestCrawler.php中尝试获取非对象的属性致命错误:调用成员函数find()在第20行的/var/www/html/crawler/TestCrawler.php中的非对象上,我已经使用过,但出现以下消息:警告:文件\u get\u contents():无法打开流:HTTP请求失败!第75行的/var/www/html/crawler/simple_html_dom.php中找不到HTTP/1.1 404注意:第18行的/var/www/html/crawler/TestCrawler.php中尝试获取非对象的属性注意:第19行的/var/www/html/crawler/TestCrawler.php中尝试获取非对象的属性致命错误:调用成员函数find()在第20行的/var/www/html/crawler/TestCrawler.php中的非对象上,我已经使用过,但出现以下消息:警告:文件\u get\u contents():无法打开流:HTTP请求失败!第75行的/var/www/html/crawler/simple_html_dom.php中找不到HTTP/1.1 404注意:第18行的/var/www/html/crawler/TestCrawler.php中尝试获取非对象的属性注意:第19行的/var/www/html/crawler/TestCrawler.php中尝试获取非对象的属性致命错误:调用成员函数find()在第20行的/var/www/html/crawler/TestCrawler.php中的非对象上,您能给出详细解释吗?此代码将此错误返回给我:`Fatal error:Call to a me