无头浏览器,支持java的完整javascript [英] Headless browser with full javascript support for java

查看:1423
本文介绍了无头浏览器,支持java的完整javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用HtmlUnit(开发人员做得很好)作为我之前的一些应用程序的无头浏览器,但javascript支持不适用于我的下一个应用程序将访问的某个网站。

I have been using HtmlUnit (the developers did a great job) as an headless browser for some of my previous applications but the javascript support isn't working for some website that my next application will be accessing.


  1. 我听说过Python的QtWebKit绑定,但我的应用程序是Java,还是WebKit或QtWebKit的Java绑定?

  1. I heard about QtWebKit binding for Python but my application will be in Java or is there a Java binding for WebKit or QtWebKit?

有没有人知道一个好的无头浏览器支持Java?

Does anyone know a good headless browser for Java with full javascript support?


推荐答案

Nathan Ridley对另一个类似问题的回答是最完整的一个到目前为止我找到了。

Nathan Ridley's answer to another similar question is the most complete one I've found so far.

无论如何,如果一切都失败了,你可以使用Python或JS替代方案,将其功能作为服务器中的web服务公开,然后你的Java应用程序可以通过Web服务使用无头浏览器的功能。设置会很痛苦,但如果没有其他工作可行,它可能是一个可行的选择。

Anyway, if everything fails, you could use a Python or JS alternative, expose its funcionality as a webservice inside your server, and then your Java application could use the headless browser's funcionality through the webservice. It would be a pain to set up, but it may be a viable alternative if nothing else works as desired.

此外,有一些用于Java的无头浏览器包装器;也许有可能围绕这些建立一个测试解决方案,具体取决于要求。

Also, there are some "non-headless" browser wrappers for Java; maybe it would be possible to build a testing solution around those, depending on the requirements.

这篇关于无头浏览器,支持java的完整javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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