A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Java EE 7 Tutorial Volume 1 or Volume 2
this week in the
jQuery UI in Action
Using a servlet to log into a webpage
Joined: Mar 18, 2007
May 17, 2007 11:54:00
I need to get a
to pull info off of a page that I am sent to after logging into a website.
URL url = new URL("https://thesiteurl/Login.aspx"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); InputStream page = conn.getInputStream();
The above code gets me the login page. What I can't figure out is how to log in to get the needed page after login.
Any ideas on how to go about doing this?
Author and ninkuma
Joined: Jan 10, 2002
May 17, 2007 12:20:00
I would assume that the authentication is there just to prevent such activity. That said, you might want to look into tools such as HttpClient.
Asking smart questions
Books by Bear
I agree. Here's the link:
subject: Using a servlet to log into a webpage
Regarding login into a webpage using java code ?
Get the URL of the page being redirected to?
How to display content of a url by using httpurlconnection?
HttpURLConnection or URLConnection to login in to sites
j_security_check 'next' page?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014