Win a copy of Java Challengers this week in the Java in General forum!
  • 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:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

java program that connects to a webpage

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

i am wanting to write a program that connects to a webpage that my brother has made. i want to make it kind of like the ebay program that retrieves how long is left in the auction and other details that would be stored in a database. is there a way to do this? am i in the right forum to be askign this question?

thanks
 
Rancher
Posts: 43024
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, this isn't the right forum because servlets have nothing to do with it, so someone will move it to a more appropriate forum.

There are various ways to achive this. The simplest would be to construct a java.net.URL object, and then retrieve the web page as a string through its getContent method. That probably isn't much use, though, if you need to access specific parts of the page later.
I would probably use HttpUnit for this. It can retrieve pages, and then gives you access to the contents basically as a DOM tree. You can even follow the links in a page, and submit forms if necessary.
[ May 09, 2006: Message edited by: Ulf Dittmer ]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic