How to moved between HTML Links in web page using java jsse

P

Paul B

Hi,

I am trying to write a program that would move between html links on a
web site
(HTTPS), so far I am able to connect to the site pass the username and
password.
However the next time I try to move to a link which appears in the web
site I can not get the correct information to be returned.

Here is what I am trying to achive.

// Get the page with username and password parameters.
URL site = URL new("https://www.test.com/webapp/Link/login.do?username=user&password=name");

// Setup buffer to read the information
BufferedReader in = new BufferedReader(
new InputStreamReader(
site.openStream()));

// String to hold the information.
String inputLine;

while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);

// Know trying to go to a link in the page.
URL site2 = URL new("https://www.test.com/webapp/Link/test.do");

// Setup buffer to read the information
BufferedReader in2 = new BufferedReader(
new InputStreamReader(
site2.openStream()));

// String to hold the information.
String inputLine2;

while ((inputLine2 = in2.readLine()) != null)
System.out.println(inputLine);


in.close();
in2.close();

Any help is appreciated.

Thanks,
Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top