• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to read data from an HTML table

 
Rafael Rangel
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basic idea


Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65123
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Rafael Rangel
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65123
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65123
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Similar topic here.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic