title: Jsoup javascript button clicking
body: <p>How do I perform a click on a javascript button using Jsoup?</p>
  
  <pre><code> String html = Jsoup.connect(url)
                  .followRedirects(true)
                  .data("login_name", username)
                  .data("password", userpassword)
                  .method(Method.POST).get().html();
  </code></pre>
  
  <p>This is the code I used to set the username and password fields in a website, however when I grab the html, it gives me the html of the login page with the page's fields filled out, rather than the page after login. So that must mean that Jsoup simply filled the fields out, but didn't log me in. How would I go about doing that? Also, the login button doesn't have an id element, nor does it have a name element. It only has javascript. Sorry if I'm not being clear, I'm new to this. Here's the html code for the form:</p>
  
  <pre><code> &lt;form name="form" id="form" method="POST" action="/portal/login?etarget=login_form" autocomplete="off"&gt; 
  </code></pre>
  
  <p>This is the html code for the login button:</p>
  
  <pre><code>&lt;a href="javascript:document.form.event_override.value='login';document.form.submit();" class="btn_css"&gt;    
  </code></pre>
  
  <p>How would I 'click' the login button using Jsoup? Also, I tried using the .post() method instead of .method(Method.POST), however when I did that, my program didn't work, and gave me this message: "Error: 400 error loading URL"</p>
  
  <p>Also I do not own the website, and I'm using this in a native app that I'm building for Android. </p>