title: Having trouble loggin into website with Jsoup,
body: <p>I'm trying to log into a website with jsoup, I'm pretty sure I am parsing all the things I need to, I just can't figure out what's wrong. </p>
  
  <p>I am using this for reference: <a href="http://cs.harding.edu/fmccown/android/Logging-into-Pipeline.pdf" rel="nofollow">http://cs.harding.edu/fmccown/android/Logging-into-Pipeline.pdf</a></p>
  
  <p>Here is the code that is in my AsycnTask doInBackground:</p>
  
  <pre><code>            Connection.Response loginForm = Jsoup.connect(url)
                      .userAgent("Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6")
                      .referrer("http://www.google.com")
                      .method(Connection.Method.GET)
                      .timeout(10000)
                      .execute();
  
              Document doc = loginForm.parse();
  
              //Random values you need to parse to lectio
              String VIEWSTATEXvalue = doc.select("input[name=__VIEWSTATEX").attr("value");
              String EVENTVALIDATIONvalue = doc.select("input[name=__EVENTVALIDATION").attr("value");
  
              Log.v("MainActivity",VIEWSTATEXvalue + EVENTVALIDATIONvalue);
  
  
  
              doc = Jsoup.connect(url)
                      .userAgent("Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6")
                      .referrer("http://www.google.com")
                      .data("m$Content$username2", username)
                      .data("m$Content$password2", password)
                      .data("__VIEWSTATEX",VIEWSTATEXvalue)
                      .data("__EVENTVALIDATION",EVENTVALIDATIONvalue)
                      .data("__EVENTTARGET","m$Content$submitbtn2")
  
                      .cookies(loginForm.cookies())
                      .post();
              Log.v("MainActivity", doc.toString());
  </code></pre>
  
  <p>But the problem is it doesn't contain the document of the page when I am logged in, it contains the document for an error page that just says "something went wrong".</p>
  
  <p>I'm guessing this is because I am not parsing all of the parameters.</p>
  
  <p>This is the page I am trying to login to: <a href="https://www.lectio.dk/lectio/11/login.aspx?lecafdeling=4733693054" rel="nofollow">https://www.lectio.dk/lectio/11/login.aspx?lecafdeling=4733693054</a></p>
  
  <p>having looked into to some of forms being submitted this was something i could find:</p>
  
  <pre><code>//&lt;![CDATA[
  var theForm = document.forms['aspnetForm'];
  if (!theForm) {
  theForm = document.aspnetForm;
  }
  function __doPostBack(eventTarget, eventArgument) {
  if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
      theForm.__EVENTTARGET.value = eventTarget;
      theForm.__EVENTARGUMENT.value = eventArgument;
      theForm.submit();
  }
  }
  //]]&gt;
  </code></pre>
  
  <p>But I don't how to parse the proper value for these</p>