DOM element/image locations

Topics: Developer Forum, User Forum
Sep 6, 2010 at 2:34 PM

When using javascript in the browser I can get image locations even if the image didn't have the x/y coord set via css or attribute.  If I render DOM with the agility pack, will I be able to get the x/y coord of elements such as images and links?

Sep 6, 2010 at 5:06 PM

no, Html Agility Pack is not a renderer, it is just a parser. It takes the HTML and creates a hierarchical object structure.  To do what you need you'll have to use a rendering engine like the .NET WebBrowser control or the Gecko# library. The first allows you to use Internet Explorer to render a page, the later uses to the Gecko rendering engine found in Firefox. Even with those I'm not sure if the x/y coordinates are easily available, it may take some work doing hit testing to find out