title: How to get the source code of a html page using VB.net?
body: <p>I'm writing a program that gets the source code of a web page with a video on it. It then uses regular expressions to isolate the download link of that video. then it uses <code>httpwebrequest</code> and <code>httpwebresponse</code> to download the video. My problem arises when certain sites have a page where you have to click continue in order to get to the video page. </p>
  
  <p>For example, there is a video playing on <a href="http://nextgenvidz.com/view/s995xvc9e2fv" rel="nofollow">http://nextgenvidz.com/view/s995xvc9e2fv</a> called "<strong>The.Matrix.Reloaded.2003.mp4</strong>" so I tell my program to get the source code for the url "<a href="http://nextgenvidz.com/view/s995xvc9e2fv" rel="nofollow">http://nextgenvidz.com/view/s995xvc9e2fv</a>" but it can't find the video's download link because it's searching for the file in the "continue" page's source code. If you go to that website above and view source, you won't see the link. Then, click continue and do the same when the video appears and you'll notice that the file is only there in the second one.</p>
  
  <p>How can I get the source code for the page that the video is playing on, and not the page where I have to click continue?</p>
  
  <p>I am trying to use this code:</p>
  
  <pre><code>Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      Dim Loading As String = "Loading..."
      TextBox1.Text = Loading
      Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(TextBox2.Text)
      Dim response As System.Net.HttpWebResponse = request.GetResponse()
  
      Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())
  
      Dim sourcecode As String = sr.ReadToEnd()
      TextBox1.Text = sourcecode
  End Sub
  </code></pre>
  
  <p>Maybe there's a way to auto select the "Continue" button programmatically?</p>