Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98825

Finding sub web element index for a specified class_name

$
0
0

I'am trying to extract a webelement based on the following info from the webelement inspection.

div jstcache="294" data-result-index="1" data-section-id="or:1" ved="1i:3,t:12690,e:2,r:1,p:lW-7XZbYHcqcjLsPleeBqAI:1" role="listitem" class="section-result-content">

As can be seen from the web element details the class name is "section-result-content" and the 'data-result-index' is 1. How can i write a code for driver to find the web element based on index=1 or 6,7 etc..

here is a code i tried

driver.find_element_by_class_name('section-result-content'[1])

Viewing all articles
Browse latest Browse all 98825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>