• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

basic tools needed create substrings

 
Adam Confino
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Java Gurus,

I am trying write a program that will go to a website, grab the html source code, and parse sections out of it. So far I can return the html source code as a giant string. My question is, what basic classes and methods should I learn to scan through this string and eventually save snippets of data?

I've looked at the split and substring methods on the String class. Other tutorials have suggested the use of the Pattern class, scanner class, and matcher classes. Your thoughts?

As always, thanks for your time.
Adam
 
John de Michele
Rancher
Posts: 600
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adam:

This is a good place to start.

John.
 
Aneesh Vijendran
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Adam ,

Do you intend to get the HTML and parse it yourself ? I would mark that as Crazy. You might end up with unexpected results and out of memory exceptions and waste some nice time.

Try using some well tested HTML parsers. I would personally recommend
jerichohtml.sourceforge.net
.

It's clean and friendly.

Cheers
Aneesh
 
Adam Confino
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic