From: Ahmed A. <asa...@ya...> - 2016-07-27 14:58:24
|
Hi, Put a dot at the beginning, so it starts relative from the node, not from the document root. Ahmed From: nonSonoPaola <non...@gm...> To: htm...@li... Sent: Wednesday, July 27, 2016 4:39 PM Subject: [Htmlunit-user] getFirstByXPath help needed Hi, I'm parsing an html like the attached one.I need to iterate on report items and, for each item, retrieve item-chart and item-table nodes.If I perform getFirstByXPath or getByXPath methods (on a report-item node) with the following xPath query://div[contains(@class, 'item-chart')]I always get the first matching element in the html document instead the first beginning from the current report item. Can any one explain me what is wrong with my test case? Thanks, Laura |