I am trying to click on a button using selenium. My code states it is unable to find the css_selector
with said class name. The class name has spaces in it, which lead me to use the css_selector
object. When I try to pass the class name in the 'css_selector' object, it fails since the class name is a string, which is not callable. The website is password protected otherwise I would share the full code. This is what I have so far.
# Button I wish to click
<a href="#" class="btn btn-alt see-full-list-btn">See Full List</a>
# Once button is clicked, it changes to:
<a href="#" class="btn btn-alt see-full-list-btn" style="display: none;">See Full List</a>
What I have tried:
driver.find_element(By.CSS_SELECTOR("btn btn-alt see-full-list-btn")) # str object not callable
driver.find_element(By.CSS_SELECTOR,"btn btn-alt see-full-list-btn")
# Message: no such element: Unable to locate element: {"method":"css selector","selector":"btn btn-alt see-full-list-btn"}