Question

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.

Was it helpful?

Solution

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).

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top