I am tasked with a project whereby I need to create a scaled down version of a Firebug like UI where the user can load an HTML page, and as they hover the mouse over the elements they’ll be highlighted. The app will allow the users to select a table to be screen-scraped….haven’t got to that part as yet.
Any advice?
Thanks
Well, I haven’t used the Firebug UI, but I have done exactly what you describe using the .NET 2.0 WebBrowser control in a WinForms app.
Basically I added the WebBrowser and a Timer control to the form then in the timer elapsed event, I query the mouse position using the GetCursorPos native function and use the WebBrowser.Document’s (HtmlDocument class) GetElementFromPoint method (adjusting the x and y position to be relative to the browser control).
This returns whatever HtmlElement is under the mouse position. Here’s the meat of the method:
After you get the HtmlElement, you can get the InnerHTML to parse as you see fit.
Richard