GaryAFromOz
New member
- Joined
- May 20, 2012
- Messages
- 4
- Programming Experience
- 10+
I want to retrieve all input, select and textarea fields only and possibly change their data value. I currently declare as:
Dim theElementCollection As HtmlElementCollection = WebBrowser1.Document.All ' which I then iterate through and select on tag name.
I would like to be more efficient and do something like:
Dim theElementCollection As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("input", "select", "textarea")
but GetElementsByTagName doesn't appear to support multiple selections. I saw on the net where someone declared as: Dim Tags As HtmlNodeCollection = docNode.SelectNodes("//input | //select | //textarea")
I tried this but HTMLNodeCollection is not referenceable under HtmlDocument. I have played around a bit and can't see an equivalent. Can anyone assist?
Dim theElementCollection As HtmlElementCollection = WebBrowser1.Document.All ' which I then iterate through and select on tag name.
I would like to be more efficient and do something like:
Dim theElementCollection As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("input", "select", "textarea")
but GetElementsByTagName doesn't appear to support multiple selections. I saw on the net where someone declared as: Dim Tags As HtmlNodeCollection = docNode.SelectNodes("//input | //select | //textarea")
I tried this but HTMLNodeCollection is not referenceable under HtmlDocument. I have played around a bit and can't see an equivalent. Can anyone assist?