aspose file tools*
The moose likes Java in General and the fly likes How to read data from an HTML table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to read data from an HTML table" Watch "How to read data from an HTML table" New topic
Author

How to read data from an HTML table

Rafael Rangel
Greenhorn

Joined: Jun 18, 2001
Posts: 8
I can't believe no one has posted an answer to this question.

I'm trying to read from an html page on the web and extracting the data from a table so I can use for further processing.

I can come up with crude code, but is there a common or standard way, perhaps HTML-table-read-classes/methods?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Basic idea


Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

Eric's code assumes that you are writing the HTML page. If you are talking about "screen scraping", you're in the wrong forum.
[ January 04, 2006: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Rafael Rangel
Greenhorn

Joined: Jun 18, 2001
Posts: 8
Not sure what you mean by screen scraping.

I am not writing the HTML page. I am writing a java stand alone program. And there is a web page on the internet that has a table, and I want to extract the data from that table, and put the data into a string array (or something).

Okay, so maybe I'm in the wrong forum. But there was a related topic titled "indexing table" in this forum:
http://www.coderanch.com/t/112965/HTML-JavaScript/Indexing-Table
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

Originally posted by Rafael Rangel:
I am writing a java stand alone program. And there is a web page on the internet that has a table, and I want to extract the data from that table, and put the data into a string array (or something).


Yup, that's what's known as "screen scraping" (since you are trying to "scrape" the data from a web page "screen".)

As this is not a question on writing HTML, I'm moving it to the Java in General (intermediate) forum.
[ January 04, 2006: Message edited by: Bear Bibeault ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

Similar topic here.
 
 
subject: How to read data from an HTML table
 
Similar Threads
Convert Part Of HTML Table Into EXCEL
import an file
how to read specific data from a web page..
How to allow sorting of table?
very very urgent... read data from jsp table.