PHP使用file_get_html获取https://piugame.com页面源码时遭遇重定向循环问题的咨询
PHP使用file_get_html获取https://piugame.com页面源码时遭遇重定向循环问题的咨询
我想通过PHP获取https://piugame.com的HTML源码,但运行代码后出现了如下错误:
Warning: file_get_contents(https://piugame.com): Failed to open stream: Redirection limit reached, aborting in /simple_html_dom.php on line 82
之后我尝试用iframe标签嵌入这个网址,打开开发者工具后发现页面陷入了重定向循环,截图如下:

想请教一下:这个重定向循环是什么原因导致的?我该怎么解决这个问题,成功获取到页面的HTML源码呢?
以下是我用来获取源码的PHP代码:
<?php include 'simple_html_dom.php'; $html = file_get_html('https://piugame.com'); echo $html; ?>
还有用来测试重定向的HTML代码:
<HTML> <iframe src="https://piugame.com"></iframe> </HTML>
备注:内容来源于stack exchange,提问作者LEVI PIU_
相关产品推荐
相关产品推荐

