Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

HTML Elements Collection Has "Nothing"

$
0
0

Hi Everyone,

My objective is to get the information from a table on a webpage into a WPF application.
how its displayed is not the issue (DB, List Object, etc.) the issue is around actually getting the info.

I made some test HTML code with just a table inside and used this code:

    Private Sub Button_Click_1(sender As Object, e As RoutedEventArgs)

        Dim Browser As New WebBrowser
        Dim Request As WebRequest = WebRequest.Create("C:\TestTable.html")
        Dim Response As WebResponse = Request.GetResponse

        Browser.DocumentStream = Response.GetResponseStream

        Dim HTMLDoc As HtmlDocument = Browser.Document

        Dim PageElements As HtmlElementCollection = HTMLDoc.All

        For Each Element As HtmlElement In PageElements

            MsgBox(Element.InnerText)

        Next

    End Sub

all goes fine no errors, but the "PageElements" (the HtmlElementCollection) is empty (Nothing)
What could i be doing wrong?
Should i be using the html elements object?
I can get the actual text of the HTML, could i use this to effectively create a table/list?
I am using Visual Studio 2012 Express Edition on Windows 8 Ent. X64

Thanks in advance to any assistance
Kind Regards,


Maheshvaran Padiachi


Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>