[webkit-dev] Fwd: help

Julien Chaffraix julien.chaffraix at gmail.com
Thu May 8 11:20:35 PDT 2008


Hi,

[I have assumed you are using the Qt code as your previous post was about Qt]

>  I want to develop an application  using webkit, my application in the fact
>  consists to extract the links from a html page.

It is not currently possible as WebKit DOM bits are not exported in Qt
but it is planned for Qt 4.5
(http://labs.trolltech.com/forums/topic/31).

If you *really* want to try, you will need to look at the code in
WebKit/qt/Api/*. Your goal is to get access to a WebCore::Document.
After a quick look at the code, I would say that
QWebFramePrivate::core(QWebFrame*) is a good candidate (you get a
Frame that has a pointer to its Document).

Once you get access to the Document, you have several methods:
- traverse the DOM and test if the nodes are links (inefficient at least)
- use Document::getElementByTagName (the simplest way I would say)
- use Node::querySelectorAll (maybe better if you want to query only a
portion of the DOM tree)

>  I am new to WebKit technology.
>  If you have any document for beggening send it for me, please.:,(

The Qt part has a good documentation on the trolltech website (which
is also present in the code). For the rest, the code is your friend
(it is made to be readable / hackable).

Hope it helps,

Julien


More information about the webkit-dev mailing list