-1

Can anyone help me with the css selector for the below element. Here there are multiple elements available with same class name. Please use inner text to form a css selector for this

<div class="title kpi-tile3-title o9-tooltip" data-o9title="Safety Stock">Safety Stock</div>
Prophet
  • 32,350
  • 22
  • 54
  • 79
  • 2
    ["Can Someone Help Me" is not an actual question](https://meta.stackoverflow.com/a/284237/162698) – Rob Sep 28 '22 at 09:30

2 Answers2

0

It is not possible.
Selenium CSS Selectors do not support locating elements based on their text content.
See this or this or other similar questions about that.

Prophet
  • 32,350
  • 22
  • 54
  • 79
0

EDIT

Try this:

driver.find_element_by_css_selector("div:contains('Safety Stock')")

or this:

driver.find_element_by_css_selector("div[data-o9title='Safety Stock']")
Alichino
  • 1,668
  • 2
  • 16
  • 25