Getting information from an HTML page in C # (WebBrowser)

1

I'm trying to get information from a website and I'm having trouble getting the correct result.

Basically, I need to get the software version from the site: link

What interests me is the line:

<span class="download-version__version">2.4.6 <span class="german-flag">Deutsch</span></span>

I want to get the data from the "download-version__version" class and I'm not getting ...

Follow the code:

var htmlElement = webBrowser.Document.GetElementsByTagName("span");

foreach(HtmlElement htmlEl in htmlElement)
{
    String nameStr = htmlEl.GetAttribute("class");
    if (nameStr != null && nameStr.Length != 0)
    {
        String contentStr = htmlEl.GetAttribute("download-version__version");
        MessageBox.Show(contentStr);
    }

Is there a functional method?

    
asked by anonymous 14.09.2018 / 15:46

0 answers