Is there any other way to click this span? Not by span content?

33 Views Asked by At

I want to click the 1st span element

<ul class="tabsList"><li><span>Prihlásenie</span></li><li><span>Registrácia</span></li></ul>

For Each span As HtmlElement In WebBrowser1.Document.Body.GetElementsByTagName("span")

                If span.OuterHtml.ToString().Contains("Prihlásenie") Then

                    span.InvokeMember("click")

                    Exit For

This works fine. But I don´t want to click it by innertext. I guess it is quite hard to specify, because it has no attributes.

0

There are 0 best solutions below