Needing Help ASAP!

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
2 posts Page 1 of 1
Contributors
User avatar
3aaBrSbeel
Top Poster
Top Poster
Posts: 139
Joined: Fri Jun 01, 2012 9:34 am

Needing Help ASAP!
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!
You do not have the required permissions to view the files attached to this post.
Code'n'Stuff Signature Of 3aaBrSbeel
®║▌│█│║▌║││█║▌║▌║▌
✔ Verified Official Code'n'Stuff account ᵀᴴᴱ ᴼᴿᴵᴳᴵᴻᴬᴸ
Image
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: Needing Help ASAP!
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
2 posts Page 1 of 1
Return to “Coding Help & Support”