Results 1 to 1 of 1
Thread: Filling out HTML forms.
- 04-10-2013, 07:00 PM #1
Filling out HTML forms.
Ok guys, I am trying to write a simple program that will log in to a webpage and store a cookie. So far, I have no idea where I'm supposed to start. I have been digging in URLConnection and HTTPConnection but I don't understand what part of it is actually submitting post data. I don't want to use the Robot class because I don't want the program to interfere with the user, so I'm using URLConnections.
These are the two fields I am working with
<div style='position:relative;'><input type="text" id="username" name="user[login]" value="" class="btipsy" title="Enter your username." /></div> <div style='position:relative;'><input type="text" id="username" name="user[login]" value="" class="btipsy" title="Enter your username." /></div>
EDIT: As far for handling cookies, I was digging through the CookieStore and that will probably be what I need for that. However I can't seem to find any good ones for URLConnection submitting to forms.
EDIT 2: From what I can tell this might not be possible with just URL gets and posts, and people keep giving advice to other people in older threads to use things like http://htmlunit.sourceforge.net/ Are they correct in saying this?
If someone could point me in the right direction on where to start for this that would be great.
Last edited by Dark; 04-10-2013 at 07:15 PM.
- Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
- +Rep people for helpful posts.
- By zirbinator in forum Java 2DReplies: 3Last Post: 02-09-2011, 03:36 AM
- By aborgeld in forum Advanced JavaReplies: 0Last Post: 01-08-2011, 02:37 PM
- By MysticalMagnet in forum New To JavaReplies: 4Last Post: 11-14-2010, 02:41 AM
- By Bgreen7887 in forum New To JavaReplies: 8Last Post: 11-04-2010, 07:51 AM
- By jiten.mistry in forum Advanced JavaReplies: 2Last Post: 04-28-2008, 11:56 AM