I want to use it as a web crawler. It can navigate some url, submit a form and extract something useful. I need to find element by xpath(this is may be done by execute javascript) and interact with end user who click on an element to tell me he need this element extracted.
So I need get information such as the total DOM tree of the web page(the rendered information such as element's width, height and position), auto fill form(this can be done by execute javascript) and get the element click/selected by user. Can webkit for swt help me with this goal? thanks.
I suspect you are out of luck on that one, because people here are still dealing with more fundamental issues than providing programmatical access to the browser internals.
I suggest you take a closer look at the SWT mozilla engine. It offers a mozilla-specific (XPCOM) java API with which you can do almost anything that is also possible in javascript, directly from within java. You can access the DOM easily; doing the xpath stuff may require additional work