views:

797

answers:

2

Hi all, i'm trying to extract the content of an special div-tag(defined by his classname) out of a string that contains html source. I think the regexp-features of Java are not as easy to use as in perl, right?

Does anyone did this before and can give me a piece of code? perhaps dom-browsing is a good solution, but i didn't found any tutorials, matching to my problem.

A: 

Based on your comments it sounds like you have a general case ("crawler") and thus you're effectively parsing an XML file. If the source page is xhtml, then you have a variety of options in various XML libraries. (JDom, for example).

+1  A: 

You could use HTML Parser or some other HTML parsing library from this list.

A_M