This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes Java code for extracting data from a HTML Table from a web page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Reply locked New topic
Author

Java code for extracting data from a HTML Table from a web page

Nandu Vajjala
Greenhorn

Joined: Nov 12, 2005
Posts: 8
Hi
We need some pointers on how do we extract data from a HTML Table from a web page using a Java program.
For instance: http://www.fsa.gov.uk/ukla/hcaList.do

Above link has a table in the below format

Company name Country of Incorporation Home member state
3I INFRASTRUCTURE PLC CHANNEL ISLANDS UNITED KINGDOM
888 HOLDINGS PLC GIBRALTAR UNITED KINGDOM

We need to extract the data and convert it to a csv format file.

Thanks
Anand Vardhan


Praveen mourya Kumar
Greenhorn

Joined: Oct 14, 2008
Posts: 16
Hi,

your problem can be solve by using the webcrawler in Java. for more help, please try to visit the following link :
http://java.sun.com/developer/technicalArticles/ThirdParty/WebCrawler/
Good Luck


SCJP 1.6..
Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
You should better use Javascript to extract the HTML data. Using Java means you program needs to act as an HTML client. Although open source solution like Jakarta's HttpClient already existing, Javascript is much better choice as the browser already support it. In particular, you will probably need to use HTA (HTML Application) file (see MSDN for it, basically a HTML file with embedded javascript renamed to .hta).
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Do not duplicate threads. Closing this one. Continue there.


[My Blog]
All roads lead to JavaRanch
 
jQuery in Action, 2nd edition
 
subject: Java code for extracting data from a HTML Table from a web page
 
Similar Threads
How to read data from an HTML table
Java code for extracting data from a HTML Table from a web page
How to extract unstructured financial statements from 10-K,10-Q filed with Sec
Where are U from?
WA #1.....word association