Search code examples
c#.netgeckofx

How to get Dom tree in GeckoFX


I started to play with GeckoFX. Unfortunately I didn't found any big documentation for that. I need to get DOM tree for the page. Iterate every element and get it's information. Can someone please help me?


Solution

  • Example code:

    GeckoElementCollection links = geckoWebBrowser1.Document.GetElementsByTagName("a");
    foreach (GeckoElement link in links) {
        Debug.WriteLine(link.GetAttribute("href"));
    }