I am currently working on selenium python in firefox. I am trying to find the element using the CSS selector
element = "span:contains('Controlpanel')"
my_driver.find_element_by_css_selector(element)
But I am getting the following error:
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidSelectorException: Message: Given css selector expression "span:contains('Control panel')" is invalid: InvalidSelectorError: 'span:contains('Control panel')' is not a valid selector: "span:contains('Control panel')"
In selenium IDE I am successfully able to find the element by this field but it is not working for me in Python.