Note that there are some explanatory texts on larger screens.

plurals
  1. POSubmitting a GET to a form with Jsoup in Android
    text
    copied!<p>I am attempting to "simulate" a button press and form submission with username and password to sign into the website with source below. I have already tried this:</p> <pre><code>Document con = Jsoup.connect("http://www.twinrinks.com/adulthockey/subs/subs_entry.html") .data("subs_data1",autoLogInUsername) .data("subs_data2",autoLogInPassword) .post(); </code></pre> <p>(autoLogInUsername and autoLogInPassword are String objects)</p> <p>But that does not seem to want to work correctly. I have read around here on stack overflow, and I have tried many of the suggestions, but I can't seem to get this to work. I'm thinking my problem is either that the form is a GET instead of a POST, or that i'm not doing anything with the submit button (but I don't know how to reference it because it has no name). Thanks for your help!</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Login Page&lt;/title&gt; &lt;FONT FACE="ARIAL" SIZE="5" color="#FF00FF"&gt;Twin Rinks Ice Pavilion, Inc. Attendance &amp; Subs Program&lt;BR&gt;&lt;/font&gt; &lt;/head&gt; &lt;body onLoad="document.forms.myform.subs_data1.focus()"&gt; &lt;form name="myform" method="GET" action="subs_entry.php"&gt; Username:&lt;input type=text name=subs_data1 size="70" value=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (your email address)&lt;br&gt; Password:&lt;input type=password name=subs_data2 size="25" value=""&gt;&lt;br&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;input type=submit value="Login!"&gt; &lt;br&gt;&lt;br&gt;Leisure next session schedule is done.&lt;br&gt;Bronze next session schedule is done.&lt;br&gt;Silver next session schedule is done&lt;br&gt;Gold next session schedule is done.&lt;br&gt;Platinum next session schedule is done.&lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload