• Post Reply Bookmark Topic Watch Topic
  • New Topic

java program that connects to a webpage

 
conor murphy
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • 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
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • 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 ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!