aspose file tools*
The moose likes Java in General and the fly likes How To Read Html Page Opened In Browser Using Java Program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How To Read Html Page Opened In Browser Using Java Program" Watch "How To Read Html Page Opened In Browser Using Java Program" New topic
Author

How To Read Html Page Opened In Browser Using Java Program

panadare aniruddha
Greenhorn

Joined: Feb 06, 2011
Posts: 3


I am trying to develop a Java Application that will read a html page opend in browser
Suppose a opened page in browser is Page containing a Profile no. and Registration no. i want to read only those no.
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8815
    
    5
I'm not sure exactly where this question should go, but it's definitely not in the SCJP forum

We'll try Java in General, but I wouldn't be surprised if it gets bounced again...


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61230
    
  66

I do not believe that there is any way that an independently running Java program can query a browser for its displayed contents. Or are you talking about an Applet running within the context of the page?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ralph Cook
Ranch Hand

Joined: May 29, 2005
Posts: 479
Or are you talking about a java program that uses the URL string that one would put in a browser to obtain the same page as the browser would get, but inspects it to do something different than the browser would do (like extract certain data from the page).

I've written a program like this to "crawl" through some pages on a site to get some specific information that I wanted without having to visit all the sites. In case you're a little vague on how this works, the java program makes a socket connection to the server by using the same URL you would use in the browser address window, and gets back through that socket everything the browser would get. It is up to the java program to do whatever it wants to do with it, and also up to the program to skip everything that needs to be skipped.

rc
Mark Guo
Ranch Hand

Joined: Nov 17, 2010
Posts: 58
Leonardo Shikida
Greenhorn

Joined: Jan 02, 2003
Posts: 29
if the idea is to scrap some site, you can make your life easier using httpunit + xpath

TIA

Leo K.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How To Read Html Page Opened In Browser Using Java Program