From: ricky b. <ric...@gm...> - 2016-07-27 15:56:49
|
Hello Laura, If you do getFirstByXpath(".//div[contains(@class, 'item-chart')]") on report-item node then you will get the first div of under the report-item node. When you try to find the node by using '//', this will always try to find the node from the root html element, and when you try to find the xPath using './/' then it will search from the current node (in your case report-item). Thanks, Deb On Wed, 27 Jul 2016 at 20:11 nonSonoPaola <non...@gm...> wrote: > 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 > > ------------------------------------------------------------------------------ > What NetFlow Analyzer can do for you? Monitors network bandwidth and > traffic > patterns at an interface-level. Reveals which users, apps, and protocols > are > consuming the most bandwidth. Provides multi-vendor support for NetFlow, > J-Flow, sFlow and other flows. Make informed decisions using capacity > planning > reports.http://sdm.link/zohodev2dev > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |