Here's how you can do this:
//div[@class="content"]/div[@class="insights type1"]
In python call find_elements_by_xpath()
and get the text of each div found:
for div in driver.find_elements_by_xpath('//div[@class="content"]/div[@class="insights type1"]'):
print div.text
Note that if you need only one single div, use just find_element_by_xpath()
:
div = driver.find_element_by_xpath('//div[@class="content"]/div[@class="insights type1"]')
print div.text
Also, if these div
s can be outside of content
div
too - use //div[@class="insights type1"]
.
Hope that helps.