How to use webkit in a Java project?
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 开发者_如何学JAVAcoordinates 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!
精彩评论