Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help in how to Read a table from a Website

Status
Not open for further replies.

Kirad

Programmer
Jul 13, 2001
5
CA
I need to read a currency table from a specific website and save it to my working directory. My problem is that I don't know how to start, in reading in a specific item from a website using javas FileReading?
 
I am not sure I completely understand what you are trying to do. You are trying to read from a webpage's HTML table? If so then you could create a URLConnection to the website and parse the stream for your information. You will need to write the parser yourself but it is not very difficult. Wushutwist
 
FWIW, Sun includes an HTML parser that may do most of the work for you. The Parser and its supporting classes are in
javax.swing.text.html
 
I think that parser is mainly used to displaying HTML in SWING. We tried to use it to parse an HTML file for relevant pieces of information but it is not really design for that. Heck, HTML is not designed for that. Wushutwist
 
There are some example of how to use it in Java Network Programming. You can download the code from


You use this parser the same way you use a SAX XML parser, by creating a class that implements the callback methods of the parser to do what you need to do. You can find many examples of how to do this online. It's really easy and is MUCH better than writing a parser from scratch for your particular purpose.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top