B
BobRoyAce
I've got a WebBrowser control on a form, called WebBrowser1, and,
through code, I navigate to a web page. Now, on this web page, among
many other things, there is a <TABLE > with several rows, each having
five columns, two of which I care about.
Well I can use code as follows to find a particular TABLE on the
page...
Dim oElement As HtmlElement = WebBrowser1.Document.GetElementById
("tblSubmitSales")
This works great as I get back the TABLE element I was after.
Now, what I need to do is go after each ROW element in the returned
table element. Then, I'll want to be able to interrogate each Cell
(<TD>) element within each ROW element.
Is there a straightforward way to do this. Ideally, there'd be some
method, similar to "GetElementsByTagName", as then I could do
something like...
Dim oRowCollection As HtmlElementCollection
oRowCollection = oElement.GetElementsByTagName("TR")
Dim oCellCollection as HtmlElementCollection
For Each oElement as HtmlElement in oRowCollection
oCellCollection = oElement.GetElementsByTagName("TD")
' Do something with the cell elements here...
Next
I'd appreciate any insights on this.
In addition, are there any really good sources of detailed/extensive
information on using the WebBrowser control?
through code, I navigate to a web page. Now, on this web page, among
many other things, there is a <TABLE > with several rows, each having
five columns, two of which I care about.
Well I can use code as follows to find a particular TABLE on the
page...
Dim oElement As HtmlElement = WebBrowser1.Document.GetElementById
("tblSubmitSales")
This works great as I get back the TABLE element I was after.
Now, what I need to do is go after each ROW element in the returned
table element. Then, I'll want to be able to interrogate each Cell
(<TD>) element within each ROW element.
Is there a straightforward way to do this. Ideally, there'd be some
method, similar to "GetElementsByTagName", as then I could do
something like...
Dim oRowCollection As HtmlElementCollection
oRowCollection = oElement.GetElementsByTagName("TR")
Dim oCellCollection as HtmlElementCollection
For Each oElement as HtmlElement in oRowCollection
oCellCollection = oElement.GetElementsByTagName("TD")
' Do something with the cell elements here...
Next
I'd appreciate any insights on this.
In addition, are there any really good sources of detailed/extensive
information on using the WebBrowser control?