当前位置: 动力学知识库 > 问答 > 编程问答 >

how to get count of all the child tags using selenium and css

问题描述:

<div class="searchCenter largeFont">

<b> 1 </b>

<a href="/mytwonky/search/?p=2&q=next&mt=1"> 2 </a>

<a href="/mytwonky/search/?p=3&q=next&mt=1"> 3 </a>

</div>

How would I get a count of all the child nodes of <div>, in the above case there are three children of <div>.

What command would I use in Selenium using CSS selectors?

I found the answer:

I found the answer to my question and would like to mention below for future reference:

The above could be done by the following:

se.get_css_count("css=div#paginationContainer div[class='searchCenter largeFont']>*")

分享给朋友:
您可能感兴趣的文章:
随机阅读: