Quantcast
Channel: Selenium Python: How can I count the number of tables in a div? - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by supputuri for Selenium Python: How can I count the number of tables in a div?

$
0
0

Simple solution is using the below xpath.

//*[@id='emailwrapper']/div/div/table

Your code should be

lastTable = len(driver.find_elements_by_xpath("//*[@id='emailwrapper']/div/div/table"))-1
print lastTable

Viewing all articles
Browse latest Browse all 3

Trending Articles



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