PHP:卷曲页面,应用javascript并保存结果 [英] PHP : Curl a page, apply javascript and save result

查看:64
本文介绍了PHP:卷曲页面,应用javascript并保存结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我研究了一个PHP库,该库允许在html内容上执行javascript代码,而无需浏览器即可获取HTML修改后的内容。

I research a PHP library that allows to execute javascript code on html content to obtain HTML modified content without browser.

步骤是:


  1. 使用curl或文件获取页面获取内容

  2. 在页面上应用JavaScript脚本。

  3. 将结果页保存到服务器上的文件中。

所有功能均在一个php脚本中。

All in one php script.

编辑:

我的目标是在应用JavaScript函数后获得php网页的结果在此页面上进行一些更改。

My goal is to get the result of a php web page after applying a javascript function on this page to change some things.

是否存在一个PHP库,该库无需执行浏览器即可执行页面的javascript代码,并以HTML返回结果?

Is there a PHP library that allows to execute the javascript code of a page Without going through a browser, and return the results in HTML?

推荐答案

好,我在这里找到了解决方案:

Ok, I have found a solution here :

在PHP中执行javascript

使用HtmlUnit是 G Java程序的用户界面更少的浏览器。

Using HtmlUnit is a "GUI-Less browser for Java programs".

http:/ /htmlunit.sourceforge.net/

这篇关于PHP:卷曲页面,应用javascript并保存结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆