Page 1 of 1

Needing Help ASAP!

Posted: Sat Jul 21, 2012 4:30 am
by 3aaBrSbeel
Ok, I need help on this one.

I don't know the ID=" of this
Download button:
Untitled.png
The Link to the Full Source Code is here.

view-source:http://www.youtube-mp3.org/

Thanks in Advance!

Re: Needing Help ASAP!

Posted: Sat Jul 21, 2012 5:03 pm
by mandai
The download link itself doesn't have an ID, though you can still access the element from its parent div tag.
This tag doesn't appear until the convert video button has been clicked.

You can use this code to show the link and get the URL:
Code: Select all
    Dim inputConvert As HtmlElement

    Private Sub WebBrowser1_DocumentCompleted(sender As System.Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted

        If e.Url.ToString() = "http://www.youtube-mp3.org/" Then

            inputConvert = WebBrowser1.Document.GetElementById("submit")

        End If
    End Sub

    Private Sub btnConvert_Click(sender As System.Object, e As System.EventArgs) Handles btnConvert.Click

        inputConvert.InvokeMember("click")

    End Sub

    Private Sub btnGetLink_Click(sender As System.Object, e As System.EventArgs) Handles btnGetLink.Click
        Dim dl_link As HtmlElement = WebBrowser1.Document.GetElementById("dl_link")

        Dim links As HtmlElementCollection = dl_link.GetElementsByTagName("a")

        Dim url As String = links(0).GetAttribute("href")
        MsgBox(url)
    End Sub