Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Converting HTML into Java code??

 
Master Rice
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a relatively new programmer who is trying to write an application that parses/retrieves information from an HTML page, and extracts relevant parts of the HTML (usually from tables) into Java Strings.
I have heard of javax.swing.text.html.parser. Would this do the job, and if so, can somebody give me some pointers on how to use it. Some simple sample code would be useful, just so that I can work out how to use it.
Thanks, Neil.
 
Suresh Bansal
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also try java class StringTokenizer, Its very simple to use. Just pass it a string with delimiters and it will return back all the tokens.
 
Chris Stehno
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may also want to take a look at XMLC from Lutris (though I am not sure if there are still making it freely available). It builds a DOM object tree from an HTML document. You can then search through the tree to find the elements you want.
Hope this helps

------------------
Chris Stehno (Sun Certified Programmer for the Java 2 Platform)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic