开发者

how to find the total Number of top employers in Naukri by using Following command

开发者 https://www.devze.com 2023-02-06 05:15 出处:网络
I want the xpath count of all the Top Employers in the Naukri.com site. I used. StoreXpathCount //h2[text()=\"Top Employers\"]//following::text(),\'bann开发者_如何学编程er\'

I want the xpath count of all the Top Employers in the Naukri.com site.

I used.

StoreXpathCount

//h2[text()="Top Employers"]//following::text(),'bann开发者_如何学编程er'

In the above code i want the total number of xpaths which contain Banner text in their name.

But it is not working. Please help me out.


Of course, this is not valid XPath syntax

//h2[text()="Top Employers"]//following::text(),'banner' 

It looks like you want the following sibling table, so:

//h2[.="Top Employers"]/following-sibling::table[1]

Note: // operator means /descendant-or-self::node()/, so you don't need it for the second step.

But your question was:

I want the xpath count of all the Top Employers

I guess that would be the count of tr:

count(//h2[.="Top Employers"]/following-sibling::table[1]/tr)

Note: The source it's not aviable so I couldn't check if tbody element was present in the source or added by browser.

0

精彩评论

暂无评论...
验证码 换一张
取 消