How to find this element using Selenium (python)

Viewed 100

How to locate this element?

enter image description here

<div _ngcontent-ysj-c5>
    <div _ngcontent-ysj-c5 class="list-items unselected"> == $0
        <!---->
        " Installation "
    </div>
</div>

i have tried

driver.find_elements_by_xpath("//[contains(text(),' Installation ')]"). 

&

driver.find_element_by_xpath("//*[text()=' Installation ']").click();

but it doesn't work.

2 Answers

How about this:

driver.find_elements_by_xpath("//*[contains(.,'Installation')]")

or

driver.find_element_by_xpath("//*[.=' Installation ']")

=)

Try below locators:

driver.find_elements_by_xpath("//div[text()='Installation']")

or

driver.find_elements_by_xpath("//div[normalize-space()='Installation']")
Related