vb.net 2019 - webbrowser control
So I've isolated a web element to click before hand, so my program captures the entire element text, and iterates through a for loop to find match and clicks it on a webbrowser.
For Each element As HtmlElement In Form1.webclient.Document.All
If element.OuterHtml.ToString = itemchunk Then
element.InvokeMember("Click")
End If
Next
itemchunk can equal something like this:
<span>I'm Feeling Trendy</span>
or
<input name="btnK" class="gNO89b" aria-label="Google Search" type="submit" value="Google Search" data-ved="0ahUKEwihndSp3PPoAhUEUK0KHS7gAfMQ4dUDCAw">
or pretty much any other element you can think of
It's not feasible to click the element during the initial itemchuck building.
I know that with something that has an ID or Name can be accessed quickly and directly, but is there a faster way to locate a known element in a webbrowser other than using the above for loop? (ie I'm Feeling Trendy)
should I use a background worker while it iterates through hundreds of elements? (it does hang me up during the loop, so i probably should anyways)
is it actually faster to break down and classify elements before hand? (leaving you with a smaller group to iterate though)
Anyone come up with something quicker?
(keep in mind the elements were already isolated before hand and could be clickable, and is later matched up on a refreshed page)
edit: i've also tried keeping track of the element from point feature, but it doesn't seem to work?
anyone know if the "element from point" values change if the browser is scrolled or resized?