Solved

Reading web pages from a standalone application

Posted on 2006-06-17
2
153 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 86

Accepted Solution

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

Expert Comment

by:CEHJ
ID: 16932861
:-)
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

731 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