1. Div class="category">Dashboards One</div>
Div
class="category">Dashboard Two</div>
Div
class="category">Dashboards Three</div>
div.category but I don't know how to get Text.
.category') div('text') - Wrong
div[class='category'] and .text() ='Dashboards One'
2. <li class=""category"> <Div> Settings One</div><li/>
<li class=""category"> <Div> Settings Two</div><li/>
<li class=""category"> <Div> Settings Three</div><li/>
Thanks
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/2992dfff-57d8-4976-8d2b-7e0f008a51f8%40googlegroups.com.--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
first_div_text = browser.find_element_by_css_selector("div.class").text
from selenium import webdriver
browser = webdriver.Firefox()
div_elements = browser.find_elements_by_css_selector("div.category")
for element in div_elements:
if "Dashboards One" in element.text:
# Do something
print("Found 'Dashboards One") break
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/0190cabd-08ac-43a8-95ab-eb90b49946de%40googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/PxNIzzEHDG0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/ab76fbe7-d764-4110-b621-c709fe44f8db%40googlegroups.com.