• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How to read data from an HTML table

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


Eric
 
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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:
https://coderanch.com/t/112965/HTML-JavaScript/Indexing-Table
 
Bear Bibeault
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Similar topic here.
 
They weren't very bright, but they were very, very big. Ad contrast:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic