2

I have a task where I need to segment a web page visually so that I may be able to calculate the distance between two segments of the web page at various levels of the DOM tree. In the simple way I want to be able to obtain the boxes that enclose the display of the pages on the screen. e.g. consider this image: Image to visual of DOM structure as on display

This I drew using Chrome, which provides for each DOM node the corresponding rectangle on the display of the page in the browser. How can I get these boxes in my program so that I can process the page based upon how it looks on the screen.

4

1 回答 1

0

我可以通过使用 QtWebkeit 来做到这一点。它为每一层 DOM 树提供了 geometry() 方法,并且还提供了对 CSS 属性的访问。

于 2011-06-10T05:24:23.973 回答