Re: [Htmlparser-user] Help on extracting clean body content from web page
Brought to you by:
derrickoswald
From: James M. <jam...@a-...> - 2007-11-16 00:08:14
|
Hello, I'm trying to pull the body content from an HTML String using your parsing utilities. The problem I'm having is not how to GET the HTML. I have the HTML stored in a String. I am using Web Services, and the content that I need is provided to me via third-party code as a String object. Therefore, I need your parser to take HTML as a String object, parse it for the body tag, and return the innerHTML of the body tag as a String. Below is the content that I retrieve in a String object: <html><head></head> <body>Hello World</body> </html> String myHTML = myWebServices.getHTMLContent(); //this returns the above HTML in a String object .... ... .. //this is the missing piece, which is how to load the HTML into the parser and return the innerHTML of the BODY tag. ... .... String bodyContent = //This is the "Hello World" text that I'm looking for so that I can use it without the HTML. The FAQ does not appear to address this question. Thanks in advance for your help in clearing up these issues. James Mortensen -- James Mortensen A-CTI Development Team |