如何在Java项目中使用webkit?
我需要实现一个 VIPS 算法,这是基于想象。所以,我需要一个工具来渲染 html 页面。这是我的要求:
我想知道 html 页面中任何字符的颜色。
对于html中的任何标签,如果它有可以在浏览器上显示的内容,我想知道内容的位置,即浏览器上的起始坐标和结束坐标。
因为所有的页面都是通过我的爬虫下载的。 Webkit能够处理存储为本地文件的页面吗?
我的项目是用Java开发的。 webkit 的哪个端口合适?
http://weblogs.java.net/blog/ ixmal/archive/2008/05/introducing_jwe.html 在这个链接上,据说: WebKit 架构由两个相当大的部分组成。第一个部分是跨平台的,它负责解析文档、生成 DOM、支持 JavaScript。另一部分是平台相关的,即所谓的“端口”,用于与网络通信、在屏幕和其他设备上渲染图形内容、事件处理和其他功能,JWebPane 是一个 Java 端口,其中所有跨平台调用都是用 Java 实现的。” 由此看来,第二部分对我来说没什么用,第一部分可以满足我的所有要求,我可以只使用第一部分吗?
谁能帮助我吗?如果可能的话,请给我一些示例代码,因为我找不到任何有关如何使用 webkit 的文档。谢谢你!
为我糟糕的英语道歉!
I need to implement a VIPS algorithm, which is segmentation of a web page based on vision. So, I need a tool to render a html page. Here are my requirements:
I want to know the color of any character in html page.
For any tags in the html, if it has content which could be displayed on a browser,I want to know the location of the content, which means start coordinates and end coordinates on the browser.
Because all of the pages have been downloaded through my crawler. Is Webkit able to process pages which are stored as local files?
My project is developed in Java. Which port of webkit is suitable?
http://weblogs.java.net/blog/ixmal/archive/2008/05/introducing_jwe.html
On this link, it is said:
"The WebKit architecture consists of two considerable parts. The first one is cross-platform, it is responsible for parsing documents, generating DOM, supporting JavaScript. Another part, platform-dependent, so called "port", is intended for communicating with network, rendering graphic content on the screen and other devices, event handling, and other features. JWebPane is a Java port, in which all cross-platform calls are implemented in Java."
Based upon this, it looks like the second part is useless for me, the first one can satisfy all my requirement, can i just use the first one?
Can anyone help me? If possible, please give me some example code, because I can't find any documentation about how to use webkit. Thank you!
Apologize for my poor english!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论