1

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:

Document con = Jsoup.connect("http://www.twinrinks.com/adulthockey/subs/subs_entry.html")
            .data("subs_data1",autoLogInUsername)
            .data("subs_data2",autoLogInPassword)
            .post();

(autoLogInUsername and autoLogInPassword are String objects)

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!

<html>
<head>
<title>Login Page</title>
<FONT FACE="ARIAL" SIZE="5" color="#FF00FF">Twin Rinks Ice Pavilion, Inc. Attendance & Subs Program<BR></font>
</head>
<body onLoad="document.forms.myform.subs_data1.focus()">
<form name="myform" method="GET" action="subs_entry.php">
Username:<input type=text name=subs_data1 size="70" value="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
(your email address)<br>
Password:<input type=password name=subs_data2 size="25" value=""><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=submit value="Login!">
<br><br>Leisure next session  
    schedule is done.<br>Bronze next session schedule is done.<br>Silver 
    next session schedule is done<br>Gold 
    next session schedule is done.<br>Platinum next session  
    schedule is done.</form>
</body>
</html>
TheMasster12
  • 570
  • 5
  • 9
  • You had me lost at "But that does not seem to want to work correctly", can you provide a `LogCat` output for us? – jnthnjns Nov 21 '12 at 02:27
  • 1
    Sorry, I should have been more clear. The problem is that nothing happens, the code compiles and runs fine with no exceptions, but as far as I can tell nothing is affected at all in the webView on my android Application. – TheMasster12 Nov 21 '12 at 02:28
  • Check [this out](http://stackoverflow.com/a/6476916/1134705), I think that is your issue here. Let me know. – jnthnjns Nov 21 '12 at 02:40
  • 1
    I'm fairly sure this isn't the issue, as when I visit the site on my computer I get no cookies of any kind, no matter where I go on the site. – TheMasster12 Nov 21 '12 at 06:42

1 Answers1

0

You can place GET information directly in the URL of the website you're accessing. POST would be harder, but you aren't dealing with that.

For example, if you wanted to send the variables x=3 and y=4 to foo.com/index.html you could simply call

http://www.foo.com/index.html?x=3&y=4
AAA
  • 1,364
  • 1
  • 10
  • 15