How to use webkit in a Java project?

1.6k views Asked by At

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:

  1. I want to know the color of any character in html page.

  2. 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.

  3. Because all of the pages have been downloaded through my crawler. Is Webkit able to process pages which are stored as local files?

  4. My project is developed in Java. Which port of webkit is suitable?

  5. 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!

0

There are 0 answers