Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.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 在生产服务器上运行Selenium或等效框架_Javascript_Php_Curl_Selenium - Fatal编程技术网

Javascript 在生产服务器上运行Selenium或等效框架

Javascript 在生产服务器上运行Selenium或等效框架,javascript,php,curl,selenium,Javascript,Php,Curl,Selenium,我是PHP新手。我正在编写一个需要与Javascript交互的cURL脚本。我一直在寻找运行Javascript的方法,有几个论坛推荐使用Selenium。我已经看过一些Selenium教程,我有点犹豫,因为Selenium似乎要求主机运行浏览器并安装JRE 有没有其他方法可以在PHP中捕获Javascript输出 一个例子是打开offgamers.com这样的网站。此页面调用JS设置cookie,然后显示索引页面。我想在php变量中获取index.php页面的内容 $ch = curl_ini

我是PHP新手。我正在编写一个需要与Javascript交互的cURL脚本。我一直在寻找运行Javascript的方法,有几个论坛推荐使用Selenium。我已经看过一些Selenium教程,我有点犹豫,因为Selenium似乎要求主机运行浏览器并安装JRE

有没有其他方法可以在PHP中捕获Javascript输出

一个例子是打开offgamers.com这样的网站。此页面调用JS设置cookie,然后显示索引页面。我想在php变量中获取index.php页面的内容

$ch = curl_init();

target = "http://www.offgamers.com/";
curl_setopt($ch, CURLOPT_URL, $target);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt");
$page = curl_exec($ch);

,向我们解释,你想完成什么…提供一个例子pls@RobertRozas:我已修改了我的问题,请尝试使用在线webdriver服务,如或在另一台服务器中设置您自己的。