Solved

Reading web pages from a standalone application

Posted on 2006-06-17
2
148 Views
Last Modified: 2010-03-31
Hi all,
sorry for my english.

I don't have much experience on java so I don't know if what I want to
realize is possible or not.

I am trying to do a little standalone java application which reads web
pages, parse them and show some data.

Using URL.openConnection().connect() and some reading on it with an
InputStreamReader, I am able to read a standard web pages.

The problem is that the pages I need to read are protected: for
example, just think about a webmail sevice: first there is an
autentication form with the fields:
 username
 password

after submission you are free to navigate the pages (inbox, sent,
trash, options, ...).

I believe that when you login, username/password are stored in the
session active between your browser and the server.

In my application I am able to read the login page, find out the
user/password fields and the "action" of the form (the page following
the submit) but than I don't know what to do...

I tried to write on the connection those data and than I tried to load
the following page, but I'm always redirected to the login page: I
think I am not correctly using sessions or cookies in my application...

do anyone of you gurus have some suggestion? Maybe a link to some
tutorial? Is possible to realize my intentions with java?

I know I haven't been too much clear... my problem in summury is: I
can't read web pages from a standalone java application because I'm
always redirected to the login page.

tnx in advice
0
Comment
Question by:moGio
  • 2
2 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 125 total points
Comment Utility
You'd be better using an http library. Try Jakarta httpclient or HttpUnit
0
 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
:-)
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now