Ok so here is the HTML of the page:

<!-- Generated by F12 developer tools. This might not be an accurate representation of the original source file -->
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head>
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<meta name="description" content="Proekt za skolo">
<meta name="keywords" content="downloader,hotfile,megaupload,fileserve,filesonic">
<meta name="author" content="flAmingw0rm / www.l33ts.org">
<link title="l33ts.org" rel="stylesheet" type="text/css" href="webstyle.css" media="all">
<title>Premium Link Generator - MegaUpload, HotFile, FileServe, FileSonic and more!</title>


</head><body>
<div id="container980">
<div id="header">
<h1><a href="index.php">www.l33ts.org</a></h1>
<h2>Premium Link Generator..</h2>
</div>

<div id="main">
<div id="content">
<center><h2>Premium Download Link Generator for FileSonic, Fileserve, MegaUpload, Hotfile and More!!</h2></center>


 
  <title>RapidGen API Curl Sample Code</title>
   <meta name="author" content="rapidgen">
   <meta name="description" content="Sample RapidGen API link generation code">
 



<center>
<form method="post" action="">
<textarea onfocus="this.select();" cols="100" rows="30" name="links">Enter Links Here</textarea><br><br>
<input value="Submit Query" type="submit">
</form>
</center>
<br><br><pre style="background: lightgray; margin: 0px auto; width: auto; text-align: center; color: black; min-width: 30%;"><b>ERROR</b>: Public_Class_Form1Invalid link format</pre>
<div class="left">
<h3>Supported sites</h3>
<a href="">MegaUpload</a>,
                                <a href="">HotFile</a>,
                                <a href="http://www.filefactory.com/">FileFactory</a>,
                                <a href="http://www.depositfiles.com/">DepositFiles</a>,
                                <a href="http://uploading.com/">Uploading</a>,
                                <a href="http://fileserve.com/">FileServe</a>,
                                <a href="http://filesonic.com/">FileSonic</a>,
                                <a href="">MegaShares</a>,
                                <a href="http://netload.in/">NetLoad</a>,
                                <a href="http://easy-share.com/">Easy-Share</a>,
                                <a href="">Wupload</a>,
                                <a href="">Uploaded</a>,
                                <a href="http://uploadstation.com/">UploadStation</a><br>
</div>

                        <div class="right">
<h3>Support, Updates and News</h3>
                <p>For the latest news of this downloader, please visit <a href="http://l33ts.org/forum/Thread-Download-from-FileServe-FileSonic-MegaUpload-Wupload-and-other-sites-free-as-prem">this thread</a>.</p>
                <p>If you have any question as well, feel free to ask in <a href="http://l33ts.org/forum/Thread-Download-from-FileServe-FileSonic-MegaUpload-Wupload-and-other-sites-free-as-prem">that thread</a>. Do not PM any of the members, unless you have been told to.</p>
                       </div>

<div class="clear">&nbsp;</div>
</div>
</div>

<div id="credits">
<p>© 2011 www.l33ts.org<br>
</p>
<p><span class="small">Website designed by flAmingw0rm<a href="http://l33ts.org/"></a></span></p>
  </div>
</div>


</body></html>

1) I need to replace the text in the textarea (I.e change Enter links Here to Textbox1.text) to textbox1.text
It already has text that needs to be cleared and replaced with no id
2) I need to select submit with the type=submit - imput value = submit query function
No Id for the button- how do I invokemember(click)
3) start and stop timer (I have done that)
4) parse the link from the specific <a href=link>link</a>
- the problem here is that there are many a tags in the page - how can I chose the one above and get the text within re tags (the link) from it...

This is what I have done but it does not work...

Web browser has already navigated.....

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try
            Dim lol As String = TextBox1.Text
            Dim Elements1 = WebBrowser1.Document.GetElementsByTagName("textarea")
            For Each Elemen As HtmlElement In Elements1
                If Elemen.GetAttribute("name") = "links" Then
                    Elemen.InnerText.Remove("Enter Links Here")
                    Elemen.InnerText.Insert(0, lol)
                    Elemen.InvokeMember("submit")
                    Timer1.Start()
                End If
            Next
        Catch ex As Exception
            MessageBox.Show("Error Sorry! Please recheck links or bandwith used")
            MessageBox.Show(ex.ToString)
        End Try
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Try
        Timer1.Stop()
            Dim lol1 = WebBrowser1.Document.GetElementsByTagName("a")
            For Each lol As HtmlElement In lol1
                Dim x As String = lol.InnerText.ToString
                TextBox2.Text = x
            Next
        Catch ex As Exception
            MessageBox.Show("Error Sorry! Please recheck links or bandwith used")
            MessageBox.Show(ex.ToString)
        End Try
    End Sub
End Class

Thanks to anyone who can help me- I am new but excited member!

Dani AI

Generated

You were almost there, — a few small fixes will make this reliable.

Main issues: calling string methods on InnerText (strings are immutable; use assignment), invoking "submit" on the textarea (you need to click the form button or submit the form element), and using a Timer as the primary wait mechanism (use DocumentCompleted or poll a specific DOM node; timers are fragile for JS/AJAX-driven pages). Also, when extracting the generated URL read the anchor’s href attribute (not only InnerText) and filter anchors by context so you don’t pick the “Supported sites” links.

Example: set the textarea and click the submit button

' set the textarea content
For Each ta As HtmlElement In WebBrowser1.Document.GetElementsByTagName("textarea")
    If ta.GetAttribute("name") = "links" Then
        ta.InnerText = TextBox1.Text
        Exit For
    End If
Next

' find and click the submit input
For Each btn As HtmlElement In WebBrowser1.Document.GetElementsByTagName("input")
    If btn.GetAttribute("type").ToLower() = "submit" AndAlso btn.GetAttribute("value") = "Submit Query" Then
        btn.InvokeMember("click")
        Exit For
    End If
Next

Parse results reliably in DocumentCompleted and filter anchors

Private Sub WebBrowser1_DocumentCompleted(...) Handles WebBrowser1.DocumentCompleted
    If e.Url.ToString() <> WebBrowser1.Url.ToString() Then Exit Sub

    Dim container = WebBrowser1.Document.GetElementById("content")
    Dim anchors = If(container IsNot Nothing, container.GetElementsByTagName("a"), WebBrowser1.Document.GetElementsByTagName("a"))

    For Each a As HtmlElement In anchors
        Dim href = a.GetAttribute("href")
        If String.IsNullOrEmpty(href) Then Continue For
        If href.StartsWith("http") AndAlso Not href.Contains("l33ts.org") Then
            If System.Text.RegularExpressions.Regex.IsMatch(a.InnerText, "^https?://") OrElse a.InnerText = href Then
                TextBox2.AppendText(href & Environment.NewLine)
            End If
        End If
    Next
End Sub

Troubleshooting: inspect WebBrowser1.Document.Body.InnerHtml to see exactly where the generated link appears (inside a <pre>, directly as text, or as an <a>). If the site uses AJAX and you still miss the result, poll for the specific DOM node or its text rather than relying solely on DocumentCompleted.

I am bumping this because i really need some help!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.