title: content from a website in a text file
body: <p>My aim is to get content from a website (for instance a league table from a sports website) and put it in a .txt file so that I can code with a local file.</p>
  
  <p>I have tried multiple lines of code and others examples such as:</p>
  
  <pre><code>// prepare the web page we will be asking for
      HttpWebRequest request = (HttpWebRequest)
          WebRequest.Create("http://www.stackoverflow.com");
  // prepare the web page we will be asking for
      HttpWebRequest request = (HttpWebRequest)
          WebRequest.Create("http://www.stackoverflow.com");
  
      // execute the request
      HttpWebResponse response = (HttpWebResponse)request.GetResponse();
  
      // we will read data via the response stream
      Stream resStream = response.GetResponseStream();
  
      string tempString = null;
      int count = 0;
      do
      {
          // fill the buffer with data
          count = resStream.Read(buf, 0, buf.Length);
  
          // make sure we read some data
              if (count != 0)
          {
          // translate from bytes to ASCII text
          tempString = Encoding.ASCII.GetString(buf, 0, count);
  
          // continue building the string
          sb.Append(tempString);
          }
      while (count &gt; 0); // any more data to read?
      }
  </code></pre>
  
  <p>My issue is when trying this, is that the words request and response are underlined in read and all the tokens are invalid.
  Is there a better method to get content from a website to a .txt file or is there a way to fix the code supplied?</p>
  
  <p>Thanks</p>