How do I get information from a string html?

Flynn 1996

New member
Joined
Jan 29, 2011
Messages
1
Programming Experience
3-5
How do I get information from a string html?

Hi I am a new Italian member. I need your help.
I am working on a megaupload downloader and I can not take information from a string, that is this: <span class="down_txt2"> UltraMU.rar </ span>
It would be the name of the file that I want to download.
I tried with this code:

Private Sub WebBrowser1_DocumentCompleted (ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
dim c as string
c = WebBrowser1.DocumentCompleted.GetElementById (down_txt2)
End Sub
When I go to try it gives me the error and I can not fix it
You could write the code to be able to take the name of the file, in this case "UltraMU.rar?
Please help me. Thanks;)
 
Last edited by a moderator:
I cannot answer your question but reading it got my curiosity up so I have been looking around myself as it could be useful to me.
I ran across this comment at VB.Net Web Page Link Grabber [ VB .Net Tutorial ]

DocumentCompleted Event
The document object is filled only after the document is loaded into the WebBrowser component. So to access a document we need to wait till the document is fully loaded. To determine this event there is an event in the WebBrowser component called DocumentCompleted. But unfortunately this is not exactly as the name says. So we need to use another property to find out the document is fully complete. The property is ReadyState. The value should be WebBrowserReadyState.Complete.

There is a code sample there. (unfinished snippet example below)

VB.NET:
If (WebBrowser1.ReadyState = WebBrowserReadyState.Complete) Then
            For Each ClientControl As HtmlElement In WebBrowser1.Document.Links
                  ' to do
            Next
End If
 
Back
Top