title: HttpClient scrape data from website with login c#
body: <p>I would like to scrape some data from the following website: </p>
  
  <p><a href="http://wttv.click-tt.de/cgi-bin/WebObjects/nuLigaTTDE.woa/wa/teamPortrait?teamtable=1673669&amp;pageState=rueckrunde&amp;championship=SK+Bez.+BB+13%2F14&amp;group=204559#" rel="noreferrer">http://wttv.click-tt.de/cgi-bin/WebObjects/nuLigaTTDE.woa/wa/teamPortrait?teamtable=1673669&amp;pageState=rueckrunde&amp;championship=SK+Bez.+BB+13%2F14&amp;group=204559#</a>.</p>
  
  <p>The website contains some data about table tennis. The actual season can be accessed without login the last seasons only with login. For the actual season I have already created some code to get the data out of it and it works fine. I am using the HttpClient from the HtmlAgilityPack. The code look like this:</p>
  
  <pre><code>            HttpClient http = new HttpClient();
              var response = await http.GetByteArrayAsync(website);
              String source = Encoding.GetEncoding("utf-8").GetString(response, 0, response.Length - 1);
              source = WebUtility.HtmlDecode(source);
              HtmlDocument resultat = new HtmlDocument();
              resultat.LoadHtml(source);
  
              Do something to get the relevant data from resultat by scanning the DocumentNodes from resultat...
  </code></pre>
  
  <p>Now I would like to fetch the data from the website that needs a login. Does anyone has an idea for that how to login to the website and get the data? The login must be done by clicking on "Ergebnishistorie freischalten ..." and then entering the username and passwort.</p>