• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

How To Read Html Page Opened In Browser Using Java Program

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


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.
 
author
Posts: 9035
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Sheriff
Posts: 67645
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 479
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if the idea is to scrap some site, you can make your life easier using httpunit + xpath

TIA

Leo K.
reply
    Bookmark Topic Watch Topic
  • New Topic