Yes, the Locator Strategy below:

submit_button = driver.find_element_by_css_selector("input[type='submit']")

is syntactically correct. But as per the copy css selector it should have been:

submit_button = driver.find_element_by_css_selector("div > button[type='submit']")

Note: find_element_by_* commands are deprecated. Please use find_element() instead

Accordingly you can also use:

submit_button = driver.find_element(By.CSS_SELECTOR, "input[type='submit']")

As per copy css selector:

submit_button = driver.find_element(By.CSS_SELECTOR, "div > button[type='submit']")
Answer from undetected Selenium on Stack Overflow
🌐
Selenium Python
selenium-python.readthedocs.io › locating-elements.html
4. Locating Elements — Selenium Python Bindings 2 documentation
from selenium.webdriver.common.by import By driver.find_element(By.XPATH, '//button[text()="Some text"]') driver.find_elements(By.XPATH, '//button') The attributes available for the By class are used to locate elements on a page. These are the attributes available for By class: ID = "id" NAME = "name" XPATH = "xpath" LINK_TEXT = "link text" PARTIAL_LINK_TEXT = "partial link text" TAG_NAME = "tag name" CLASS_NAME = "class name" CSS_SELECTOR = "css selector"
Discussions

Css Selector button click with selenium (python) - Stack Overflow
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 ob... More on stackoverflow.com
🌐 stackoverflow.com
Selenium | css-selector not found
Hi, I’m trying stuf with selenium. For some reason the selector I get isn’t found. code: #Importing libraries from selenium import webdriver import pandas as pd from selenium.webdriver.common.keys import Keys impor… More on forum.freecodecamp.org
🌐 forum.freecodecamp.org
1
0
December 20, 2020
Please help: selenium can’t find the css selector for an element
The code is probably looking for the element before the webpage is fully downloaded. You should use a Webdriver Wait method to give the page a chance to load before it searches for the element. https://selenium-python.readthedocs.io/waits.html More on reddit.com
🌐 r/Python
4
0
September 14, 2019
finding items with selenium by CSS selector using multiple attributes
Your CSS selector is wrong - there shouldn't be a space between the img and the [src]. A space between items in a CSS selector means 'descendant of', so img[src] means an image with a src, but img [src] means an image with a descendant element which has a source. There probably aren't any of those on your page, so you're getting an error. In the future you can check whether your issue is with Selenium or with your CSS selector by trying out a Document.querySelector() call in your browser console to see if you can find the element with the selector you've written! More on reddit.com
🌐 r/learnpython
2
2
March 23, 2023
People also ask

Why Use CSS Selectors in Selenium?
CSS Selectors in Selenium offer a fast, reliable, and simple way to locate web elements. They are interpreted directly by the browser, making them faster than XPath. Their clean syntax improves readability, ensures consistent results across browsers, and makes maintenance easier as web pages evolve.
🌐
testmuai.com
testmuai.com › testmu ai › learning hub › css selectors in selenium
CSS Selectors in Selenium: A Complete Guide to Locating Web Elements
Why are CSS Selectors generally faster than XPath in Selenium?
CSS Selectors execute faster because browsers natively use CSS engines to render elements. XPath, on the other hand, requires an additional parsing layer to traverse the DOM, increasing processing time. This native optimization gives CSS Selectors an advantage in test execution speed, particularly for large-scale web applications.
🌐
testmuai.com
testmuai.com › testmu ai › learning hub › css selectors in selenium
CSS Selectors in Selenium: A Complete Guide to Locating Web Elements
How do CSS Selectors improve test script maintainability in Selenium?
CSS Selectors improve maintainability by providing shorter, cleaner locators that are easier to read and update. Since they closely match how browsers interpret elements, even small UI or DOM changes don’t break them as easily as XPath expressions. This makes long-term test maintenance smoother, especially in agile projects with frequent front-end updates.
🌐
testmuai.com
testmuai.com › testmu ai › learning hub › css selectors in selenium
CSS Selectors in Selenium: A Complete Guide to Locating Web Elements
🌐
ScrapeOps
scrapeops.io › home › selenium web scraping playbook › python selenium find elements css
Python Selenium Guide - Finding Elements by CSS Selectors | ScrapeOps
January 8, 2024 - Take a look below to see this in action. from selenium import webdriver from selenium.webdriver.common.by import By from time import sleep #open Chrome driver = webdriver.Chrome() #navigate to the site driver.get("https://quotes.toscrape.com") #find the h1 element h1 = driver.find_element(By.CSS_SELECTOR, "h1") #print the h1 element print(f"H1 element: {h1.text}") #find all quotes (span elements with the class: 'text') quotes = driver.find_elements(By.CSS_SELECTOR, "span[class='text']") for quote in quotes: print(f"Quote: {quote.text}") #find all tags (anything with the class 'tag') tags = dri
🌐
GeeksforGeeks
geeksforgeeks.org › python › find_element_by_css_selector-driver-method-selenium-python
find_element_by_css_selector() driver method - Selenium Python - GeeksforGeeks
July 12, 2025 - Let's try to practically implement this method and get an element instance for "https://www.geeksforgeeks.org/". Let's try to grab search form input using its id "GSC-i-id2". Create a file called run.py to demonstrate find_element_by_css_selector method - ... # Python program to demonstrate # selenium # import webdriver from selenium import webdriver from selenium.webdriver.common.by import By # create webdriver object driver = webdriver.Firefox() # enter keyword to search keyword = "geeksforgeeks" # get geeksforgeeks.org driver.get("https://www.geeksforgeeks.org/") # get element element = driver.find_element(By.CSS_SELECTOR, "input.gsc-i-id2") # print complete element print(element)
🌐
Apify
blog.apify.com › python-css-selectors
Python CSS selectors and how to use them
March 21, 2024 - A short guide with examples of using CSS selectors with two popular Python libraries for web scraping: Beautiful Soup and Selenium.
🌐
GeeksforGeeks
geeksforgeeks.org › software testing › selenium-css-selectors
Selenium CSS Selectors - GeeksforGeeks
In the context of Selenium, CSS selectors allow you to locate elements on a webpage for automation. CSS selectors are generally faster than other locators like XPath and can be more concise, making them a preferred choice for many automation testers.
Published   July 23, 2025
Find elsewhere
Top answer
1 of 2
2

As you've mentioned

The class name has spaces in it, which lead me to use the css_selector

this is right approach, however you should also make sure that one

  1. One should remove the space and put a .
  2. . represent class in CSS.

So the below code should work:

driver.find_element(By.CSS_SELECTOR, ".btn.btn-alt.see-full-list-btn")

or you can even use it with the tag a

driver.find_element(By.CSS_SELECTOR, "a.btn.btn-alt.see-full-list-btn")

or the recommended solution would be to use with explicit waits:

see_full_list_button = WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "a.btn.btn-alt.see-full-list-btn")))
see_full_list_button.click()

Imports:

from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
2 of 2
0

There is no necessity to focus on the element HTML after the click is already invoked.

As per the HTML

<a href="#" class="btn btn-alt see-full-list-btn">See Full List</a>

you can use either of the following locator strategies:

  • Using link_text:

    driver.find_element(By.LINK_TEXT, "See Full List").click()
    
  • Using css_selector:

    driver.find_element(By.CSS_SELECTOR, "a.btn.btn-alt.see-full-list-btn").click()
    
  • Using xpath:

    driver.find_element(By.XPATH, "//a[@class='btn btn-alt see-full-list-btn' and text()='See Full List']").click()
    

Ideally to click on the clickable element you need to induce WebDriverWait for the element_to_be_clickable() and you can use either of the following locator strategies:

  • Using LINK_TEXT:

    WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.LINK_TEXT, "See Full List"))).click()
    
  • Using CSS_SELECTOR:

    WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "a.btn.btn-alt.see-full-list-btn"))).click()
    
  • Using XPATH:

    WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//a[@class='btn btn-alt see-full-list-btn' and text()='See Full List']"))).click()
    
  • Note: You have to add the following imports :

    from selenium.webdriver.support.ui import WebDriverWait
    from selenium.webdriver.common.by import By
    from selenium.webdriver.support import expected_conditions as EC
    
🌐
Testmuai
testmuai.com › testmu ai › learning hub › css selectors in selenium
CSS Selectors in Selenium: A Complete Guide to Locating Web Elements
February 3, 2026 - Learn how to use CSS Selectors in Selenium to locate web elements efficiently with syntax, examples, and best practices for reliable test automation.
🌐
BrowserStack
browserstack.com › home › guide › how to find elements in selenium with python: id, xpath, css, and more
Find Elements in Selenium with Python: ID, XPath, CSS, & More | BrowserStack
January 28, 2025 - Here are some best practices that you can consider for location elements in Selenium with Python: Use Unique Identifiers as they are the most stable and reliable method for element identification. Use more precise locator strategies like CSS selectors or ID over generic methods like tag names.
🌐
Selenium
selenium.dev › documentation › webdriver › elements › finders
Finding web elements | Selenium
September 6, 2025 - from selenium import webdriver from selenium.webdriver.common.by import By driver = webdriver.Chrome() driver.get("https://www.google.com") driver.find_element(By.CSS_SELECTOR, '[name="q"]').send_keys("webElement") # Get attribute of current active element attr = driver.switch_to.active_element.get_attribute("title") print(attr)
🌐
freeCodeCamp
forum.freecodecamp.org › python
Selenium | css-selector not found - Python - The freeCodeCamp Forum
December 20, 2020 - Hi, I’m trying stuf with selenium. For some reason the selector I get isn’t found. code: #Importing libraries from selenium import webdriver import pandas as pd from selenium.webdriver.common.keys import Keys import time # creating instance for web driver driver = webdriver.Chrome() driver.get("https://soundcloud.com/discover") print( driver.title) inputElement = driver.find_element_by_css_selector("#app > header > div > div.header__middle > div > form > input") inputElement.send_keys...
🌐
W3Schools
w3schools.com › cssref › css_selectors.php
CSS Selectors Reference
Use our CSS Selector Tester to demonstrate the different selectors. The simple selectors select elements based on element-name, id, and class. In addition, there is the universal selector (*).
🌐
W3Schools
w3schools.com › css › css_selectors.asp
CSS Selectors
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING INTRO TO HTML & CSS BASH RUST · CSS HOME CSS Introduction CSS Syntax CSS Selectors
🌐
ScrapingBee
scrapingbee.com › webscraping-questions › selenium › how-to-find-elements-css-selector-selenium
How to find elements by CSS selector in Selenium? | ScrapingBee
Now that we know how to find the CSS selectors we need, let's proceed to set up Selenium and use these selectors. To get Selenium up and running, we first need to download the browser and its corresponding driver. For Chrome, we can download the browser first, and get the ChromeDriver from https://developer.chrome.com/docs/chromedriver/downloads. Next, we can install the Python ...
🌐
Besant Technologies
besanttechnologies.com › home › blogs › general › css selectors in selenium
CSS Selectors in Selenium | Using CSS Selectors in Selenium Webdriver
January 14, 2020 - This blog on CSS selectors in Selenium will help you to understand how to locate elements on webpage by using CSS Selectors with Programmatic Example.
🌐
Scrapfly
scrapfly.io › blog › answers › how-to-find-elements-by-css-selectors-in-selenium
How to find elements by CSS selector in Selenium
May 29, 2023 - from selenium import webdriver from selenium.webdriver.common.by import By driver = webdriver.Chrome() driver.get("https://httpbin.dev/html") element = driver.find_element(By.CSS_SELECTOR, 'p') # then we can get the element text print(element.text) "Availing himself of the mild, summer-cool weather that now reigned in these latitudes..."
🌐
Selenium
selenium.dev › documentation › webdriver › elements › locators
Locator strategies | Selenium
1 month ago - import pytest from selenium import webdriver from selenium.webdriver.common.by import By def test_class_name(): driver = webdriver.Chrome() driver.get("https://www.selenium.dev/selenium/web/locators_tests/locators.html") element = driver.find_element(By.CLASS_NAME, "information") assert element is not None assert element.tag_name == "input" driver.quit() def test_css_selector(driver): driver = webdriver.Chrome() driver.get("https://www.selenium.dev/selenium/web/locators_tests/locators.html") element = driver.find_element(By.CSS_SELECTOR, "#fname") assert element is not None assert element.get_
🌐
ScrapingBee
scrapingbee.com › webscraping-questions › css_selectors › how-to-use-css-selectors-in-python
How to use CSS Selectors in Python? | ScrapingBee
The select() method searches for all HTML elements that match the provided CSS selector and returns them as a list of Tag objects. If no elements match, it returns an empty list. Conversely, the select_one() method searches for the first HTML ...
🌐
TOOLSQA
toolsqa.com › selenium-webdriver › css-selectors-in-selenium
How to use and create CSS Selectors in Selenium with examples?
Subsequently, we can use them together to create a CSS Selector for locating the web element, as shown below: textarea.form-control[placeholder='Current Address'] ... Then we provided the value of the class attribute. In the end, inside the square bracket, we provided the placeholder attribute and its value. So this way, we can combine various attributes of an HTML element to locate the web element in Selenium uniquely.