A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Spring in Action
this week in the
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
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
subject: Using a servlet to log into a webpage
Regarding login into a webpage using java code ?
How to display content of a url by using httpurlconnection?
Get the URL of the page being redirected to?
j_security_check 'next' page?
HttpURLConnection or URLConnection to login in to sites
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014