Re: [Htmlparser-user] Help me
Brought to you by:
derrickoswald
From: Aravind R P. <Ara...@in...> - 2009-03-24 11:55:16
|
Hi Parser parser = new Parser(url); NodeList nl = parser.parse(null); This will give u firsrt set of all nodes. Like every node that's is inside the <html> tag. for (NodeIterator iterator = n1.elements(); iterator.hasMoreNodes();) { Node node = iterator.nextNode(); if (node instanceof Tag) { Tag tag = (Tag) node; This way u will get every node and cast it to tag from that u can get the tag name.compare it to "BODY". Once tag body is obtained take the children and repeat the same process using for loop until u get tag name "TABLE". U have to iterate through every tag.no other way.. try using a recursion. From: alaeddine [mailto:ala...@sa...] Sent: Tuesday, March 24, 2009 5:02 PM To: htm...@li... Subject: [Htmlparser-user] Help me Hi I would to extract a table from a html url and i cant make a filter please help me to do this Thank you for your help **************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS******** End of Disclaimer ********INFOSYS*** |