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

Selenium Python: How can I count the number of tables in a div?

$
0
0

I'm trying to find an element with Xpath but it changes like so:

//*[@id="emailwrapper"]/div/div/table[1]/tbody/tr/td[2]/a
//*[@id="emailwrapper"]/div/div/table[2]/tbody/tr/td[2]/a
//*[@id="emailwrapper"]/div/div/table[3]/tbody/tr/td[2]/a
//*[@id="emailwrapper"]/div/div/table[4]/tbody/tr/td[2]/a
//*[@id="emailwrapper"]/div/div/table[5]/tbody/tr/td[2]/a
//*[@id="emailwrapper"]/div/div/table[6]/tbody/tr/td[2]/a

My current assumption is that the table I'm looking for will always be that last one in the table array but I want to confirm this by counting the number of tables in the second div. Does anyone know how to do this?


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images