Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript html解析问题_Javascript_Php_Html Parsing - Fatal编程技术网

Javascript html解析问题

Javascript html解析问题,javascript,php,html-parsing,Javascript,Php,Html Parsing,我使用的是HTML解析器,它可以很好地用于 <?php include_once('../simple_html_dom.php'); echo file_get_html('http://www.google.com/')->plaintext; ?> 它向我展示了这样的错误 您需要启用JavaScript才能运行此应用程序的服务状态 但当我在浏览器中选中它时,它已经启用了 我不知道为什么会发生这种情况您的webbrowser中的JavaScript设置与此无关!您

我使用的是HTML解析器,它可以很好地用于

<?php
 include_once('../simple_html_dom.php');

 echo file_get_html('http://www.google.com/')->plaintext;
?>
它向我展示了这样的错误

您需要启用JavaScript才能运行此应用程序的服务状态

但当我在浏览器中选中它时,它已经启用了


我不知道为什么会发生这种情况

您的webbrowser中的JavaScript设置与此无关!您可以使用PHP脚本打开相关网站。您使用的HTML解析器不执行JavaScript,因此网站会响应此错误消息。@CodyKL您在webbrowser中的JavaScript设置是什么意思与此无关!这意味着浏览器设置中是否启用(允许)JavaScript并不重要。PHP脚本在服务器上执行,您尝试在PHP脚本中打开/获取网站的内容,但HTML解析器不会在请求的网站上执行/运行JavaScript!
echo file_get_html('https://app.hyperping.io/public/XXX', false, stream_context_create($arrContextOptions))->plaintext;