From: ricky b. <ric...@gm...> - 2016-07-27 16:29:59
|
Hi, Could you check that the current remort-item (on which you are calling getFirstByXpath) that you are getting is right, If yes then could you share snippet of code so I can ? Thanks, Debmalya On Wed, 27 Jul 2016 at 21:46 nonSonoPaola <non...@gm...> wrote: > Hi, > I tried with the ".//div[contains(@class, 'item-chart')]" query, with the > same result :( > > Thanks, > Laura > > 2016-07-27 17:56 GMT+02:00 ricky biswas <ric...@gm...>: > >> 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 >>> >> >> >> ------------------------------------------------------------------------------ >> 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 >> >> > > ------------------------------------------------------------------------------ > 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 > |