php访问页面不存在报404,PHP无法打开流:HTTP请求失败! HTTP/1.1 404找不到

Fatal error: Call to a member function find() on boolean in /m/viooz.ac.php on line 12

以上是在我们的页面上显示的错误,当我们尝试和刮下请求的站点的a元素查看下面的代码。

$page = (isset($_GET['p'])&&$_GET['p']!=0) ? (int) $_GET['p'] : '';

$html = file_get_html('http://viooz.ac/movies/page/1/');

foreach($html->find('a') as $element) {

print '
';

echo $url = ''.$element->href;

$html2 = file_get_html($url);

print '
';

$link = $html2->find('.cont_display a',0);

print $link = $link->href;

}

现在我知道肯定有在网站上标签,我们正在寻找它让怎么过不管我怎么改变返回的错误..

线75 simple_html_dom.php只是说:下列。

function file_get_html($url, $use_include_path = false, $context=null, $offset = -1, $maxLen=-1, $lowercase = true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)

{

// We DO force the tags to be terminated.

$dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText);

// For sourceforge users: uncomment the next line and comment the retreive_url_contents line 2 lines down if it is not already done.

$contents = file_get_contents($url, $use_include_path, $context, $offset);

// Paperg - use our own mechanism for getting the contents as we want to control the timeout.

//$contents = retrieve_url_contents($url);

if (empty($contents) || strlen($contents) > MAX_FILE_SIZE)

{

return false;

}

// The second parameter can force the selectors to all be lowercase.

$dom->load($contents, $lowercase, $stripRN);

return $dom;

}

WARNING: Don't view the content destination unless you have an ad-block you will get loads of popups.

编辑:即使在更改URL后返回相同的问题

Fatal error: Call to a member function find() on boolean in /m/viooz.ac.php on line 18

我觉得虽然我已经想通一些东西,加载页面时,它会创建一个随机的div其触发弹出窗口,除非你删除该div或触发它的其他元素不会出现..这可能是什么原因导致我们的问题?

+1

但是... http://viooz.ac/movies/page/1确实给了404.它确实没有找到。所以你的错误是预期的。有什么问题? –

+0

@jszobody即使我更正了URL http://viooz.ac/movies/page/1/,我可以确认它确实存在,但在查找“a”元素时此错误仍然保持不变。 –

+0

您试图访问的页面正在抛出404 - 服务器找不到页面。即使它在浏览时显示页面,它也会发送404错误而不是200 OK消息。 –

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值