PHP 有 HtmlUnit 端口吗?

发布于 2024-11-26 11:13:49 字数 385 浏览 4 评论 0原文

Java 库 HtmlUnit 允许您请求给定 url 的内容(据我所知,它也会执行将在该页面的加载事件上执行的 javascript)。我正在寻找同样的功能,但在 PHP 中。

我试图解决的问题是,我正在尝试将curl/wget/get_file_contents发送到一个url,该url有一些在页面加载时运行的javascript...这个javascript没有使用我正在执行的方法执行使用...并且我想使用可以实现“get”并另外执行该页面的javascript的东西...所以我的“get”结果将是初始javascript执行后的html标记。

谢谢

The Java library HtmlUnit allows you to request a given url's content (and I'm told it will also execute the javascript that would execute on that page's load event). I'm looking for this same functionality but within PHP.

The problem that I'm trying to solve is that I'm attempting a curl/wget/get_file_contents to a url that has a bit of javascript that run on page load...this javascript is not executing with the methods that I'm using...and I'd like to use something that can achieve the "get" and additionally execute that page's javascript...so my result from the "get" would be the html markup after the initial javascript has executed.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谜泪 2024-12-03 11:13:49

我用谷歌搜索了一下但找不到端口。例如此链接告诉没有可用的端口。

为了测试cartoclient的功能,使用了HttpUnit软件。它
是用Java编写的,没有Php端口。 http 单元测试是
如果路径中有 JVM,请运行。

也许PHPUnit 与 Selenium RC

Selenium RC是一个测试工具,可以让你编写自动化的代码
使用任何编程语言进行 Web 应用程序的用户界面测试
针对使用任何主流浏览器的任何 HTTP 网站。它使用
Selenium Core,一个使用以下命令执行自动化浏览器任务的库
JavaScript。 Selenium 测试直接在浏览器中运行,就像真实的一样
用户这样做。这些测试可用于验收测试(通过
在集成系统上执行更高级别的测试,而不仅仅是
独立测试系统的每个单元)和浏览器
兼容性测试(通过在不同的平台上测试 Web 应用程序)
操作系统和浏览器)。

I googled a bit but could not find a port. For example this link tells that no port is available.

To test features of the cartoclient, the HttpUnit software is used. It
is written in Java, and there is no Php port. The http unit tests are
run if you have a JVM in you path.

Maybe PHPUnit with Selenium RC?

Selenium RC is a test tool that allows you to write automated
user-interface tests for web applications in any programming language
against any HTTP website using any mainstream browser. It uses
Selenium Core, a library that performs automated browser tasks using
JavaScript. Selenium tests run directly in a browser, just as real
users do. These tests can be used for both acceptance testing (by
performing higher-level tests on the integrated system instead of just
testing each unit of the system independently) and browser
compatibility testing (by testing the web application on different
operating systems and browsers).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文