Hi, Stefan,
On Sun, Jan 30, 2005 at 12:31:12PM +0100, Stefan Groschupf wrote:
John,
I need a lib/tool that can tell me physical location of a particular html element as the page would have been displayed by a browser.
I'm not sure if I understand you correct.
With NekoHTML you can handle a html page as XML Document, so you should be able to scan the document for any tag you wish.
Alternatively you can may will find javax.swing.text.html.* useful.
Take a look http://jmvidal.cse.sc.edu/csce790/PS1/Browser.java.html.
I'm not sure if this will helps you, may you wish can specify you question.
Example: for an icon on a page, I want to know its coordinates (x,y) as if the page is displayed in browser. (x,y) should be able to tell me whether the icon is at page corner or page center.
In general case I think it's not possible to predict without doing all the browser's work - because it depends on variables such as font size, window size (and text re-flowing), interpreting CSS, executing Javascript (e.g. document.write()) etc...
In fact, I think it should be possible to automate mozilla to render the page for you and then get the DOM. I just checked that using the DOM Inspector in Mozilla you can retrieve JavaScript properties of each element, among others its offsetTop, offsetLeft, offsetWidth, offsetHeight attributes.
-- Best regards, Andrzej Bialecki ___. ___ ___ ___ _ _ __________________________________ [__ || __|__/|__||\/| Information Retrieval, Semantic Web ___|||__|| \| || | Embedded Unix, System Integration http://www.sigram.com Contact: info at sigram dot com
------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ Nutch-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nutch-developers
