C#

using DotNetBrowser;
using DotNetBrowser.DOM;
using DotNetBrowser.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace DOMGetElementsSample
{
    class Program
    {
        static void Main(string[] args)
        {
            using (Browser browser = BrowserFactory.Create())
            {
                ManualResetEvent waitEvent = new ManualResetEvent(false);
                browser.FinishLoadingFrameEvent += delegate(object sender, FinishLoadingEventArgs e)
                {
                    // Wait until main document of the web page is loaded completely.
                    if (e.IsMainFrame)
                    {
                        DOMDocument document = e.Browser.GetDocument();
                        List<DOMNode> divs = document.GetElementsByTagName("div");
                        foreach (DOMNode div in divs)
                        {
                            if (div.NodeType == DOMNodeType.ElementNode)
                            {
                                DOMElement divElement = (DOMElement)div;
                                Console.Out.WriteLine("class = " +
                                        divElement.GetAttribute("class"));
                            }
                        }
                        waitEvent.Set();
                    }
                };
                browser.LoadURL("http://www.google.com");
                waitEvent.WaitOne();
            }
        }
    }
}

VB.NET

Imports DotNetBrowser
Imports DotNetBrowser.DOM
Imports DotNetBrowser.Events
Imports System.Threading

Module DOMGetElementsSample
    Sub Main(ByVal args As String())
        Using browser As Browser = BrowserFactory.Create()
            Dim waitEvent As ManualResetEvent = New ManualResetEvent(False)
            AddHandler browser.FinishLoadingFrameEvent, sub(ByVal sender As Object, ByVal e As FinishLoadingEventArgs)

                If e.IsMainFrame Then
                    Dim document As DOMDocument = e.Browser.GetDocument()
                    Dim divs As List(Of DOMNode) = document.GetElementsByTagName("div")

                    For Each div As DOMNode In divs

                        If div.NodeType = DOMNodeType.ElementNode Then
                            Dim divElement As DOMElement = CType(div, DOMElement)
                            Console.Out.WriteLine("class = " & divElement.GetAttribute("class"))
                        End If
                    Next

                    waitEvent.[Set]()
                End If
            End sub

            browser.LoadURL("http://www.google.com")
            waitEvent.WaitOne()
        End Using
    End Sub
End Module