Discussion Locked

HTML parsing

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I trying to create a class that will be able to connect to a specific URL and then parse the HTML file for any links within the page. I am a new comer to JAVA and a possible solution that I have though of is to use the StringTokenizer class and creating tokens for the a href= or src= HTML tags. Is there an alternative method for doing this? Help!

5 replies

by boyarsky

If you are using Java 1.3, there is a Swing class that does this. It is called HTMLDocument. In addition to searching for links in an HTML document, it can easily get the base URL of the document (helpful for relative links)

Good luck.

This discussion is closed to new replies.