find_element_by_name() method would fit here:

driver.find_element_by_name("quantity")
Answer from alecxe on Stack Overflow
🌐
Selenium Python
selenium-python.readthedocs.io › locating-elements.html
4. Locating Elements — Selenium Python Bindings 2 documentation
find_element(By.ID, "id") find_element(By.NAME, "name") find_element(By.XPATH, "xpath") find_element(By.LINK_TEXT, "link text") find_element(By.PARTIAL_LINK_TEXT, "partial link text") find_element(By.TAG_NAME, "tag name") find_element(By.CLASS_NAME, "class name") find_element(By.CSS_SELECTOR, ...
🌐
Selenium
selenium.dev › documentation › webdriver › elements › finders
Finding web elements | Selenium
September 6, 2025 - In our example HTML above, there are two elements that have a class name of “tomatoes” so this method will return the element in the “vegetables” list. Move Code · Java · Python · CSharp · Ruby · JavaScript · Kotlin · WebElement vegetable = driver.findElement(By.className("tomatoes")); vegetable = driver.find_element(By.CLASS_NAME, "tomatoes") var vegetable = driver.FindElement(By.ClassName("tomatoes")); fruits = driver.find_element(id: 'fruits') fruits.find_element(class: 'tomatoes') View Complete Code View on GitHub ·
Discussions

Python Selenium Find Element by Name - Stack Overflow
I am using Python / Selenium and am trying to select an input box that does not have an ID: HTML More on stackoverflow.com
🌐 stackoverflow.com
Selenium Python 2 find element by name and value? - Stack Overflow
I have been trying to locate an element on a web page, this element has the same name as other elements and no id. It does have a different value, so I would like to find the element by the name AN... More on stackoverflow.com
🌐 stackoverflow.com
April 25, 2017
Finding Element by Name Attribute in Selenium Python - LambdaTest Community
How to find an element by its name attribute using Selenium in Python? Below is my HTML file and code where i am trying to get the attribute name More on community.lambdatest.com
🌐 community.lambdatest.com
0
February 22, 2024
Finding elements by class name with Selenium in Python - Stack Overflow
How can I filter elements that have the same class? Link1. ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Readthedocs
selenium-python-test.readthedocs.io › en › latest › 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') ... ID = "id" XPATH = "xpath" LINK_TEXT = "link text" PARTIAL_LINK_TEXT = "partial link text" NAME = "name" TAG_NAME = "tag name" CLASS_NAME = "class name" CSS_SELECTOR = "css selector"
🌐
GeeksforGeeks
geeksforgeeks.org › python › find_element_by_name-driver-method-selenium-python
find_element(By.Name) driver method - Selenium Python - GeeksforGeeks
July 12, 2025 - How to use driver.find_element_by_name() method in Selenium? 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 name "search".
🌐
GitHub
iqss.github.io › dss-webscrape › finding-web-elements.html
4 Finding Web Elements | Web Scraping Using Selenium Python
Similar to XPath, Selenium can leverage and use CSS selectors to find elements on a web page. In our previous example, in which we wanted to get the search button on the example site, we can use the following selector, where the selector is defined as the element tag along with the class name. This will find an <input> element with the "btn-default" class name. We then test it by ...
🌐
Python Examples
pythonexamples.org › python-selenium-find-element-by-name
How to Find Element by Name in Selenium Python?
To find an HTML Element by name attribute using Selenium in Python, call find_element() method and pass By.NAME as the first argument, and the name attribute's value (of the HTML Element we need to find) as the second argument.
Find elsewhere
🌐
BrowserStack
browserstack.com › home › guide › locators in selenium: a detailed guide
Locators in Selenium: A Detailed Guide | BrowserStack
September 26, 2024 - The .find_element_by_class_name() method only returns the first element with the matching class. It raises a NoSuchElementException if no element exists with the given class name.
🌐
ScrapingAnt
scrapingant.com › blog › selenium-python-find-element
How to Find Elements With Selenium in Python | ScrapingAnt
July 29, 2024 - If no element with the specified ID is found, Selenium will raise a NoSuchElementException. The find_element_by_name method locates the first element with the given name attribute.
🌐
Selenium
selenium.dev › blog › 2022 › python-locators-se4
Locate your locators - Python bindings changes upcoming | Selenium
August 9, 2022 - If you’re really desperate however you can use strings instead of the By object: driver.find_element('id', "submit_button").click() driver.find_element('css selector', '.myelement child').text · If you have any plans to upgrade your Selenium client for your Python tests to recent versions of Selenium 4, definitely keep these changes in mind.
🌐
Katalon
katalon.com › blog › insights › find elements in selenium with python: a complete guide
Find Elements in Selenium with Python: A Complete Guide
February 5, 2026 - Mastering element identification in Selenium with Python is foundational for building robust and reliable web automation. By effectively employing a variety of locator strategies and adhering to best practices for stable test execution, teams ensure precise and consistent interactions with web elements, leading to more resilient and efficient automated tests. Employ Diverse Locator Strategies: Utilize `By.ID`, `By.NAME`, `By.CLASS_NAME`, `By.TAG_NAME`, `By.LINK_TEXT`, `By.PARTIAL_LINK_TEXT`, `By.CSS_SELECTOR`, and `By.XPATH` to accurately pinpoint web elements based on their attributes and DOM structure for comprehensive discovery and interaction.
🌐
Python Basics
pythonbasics.org › selenium-find-element
selenium find element by id - Python Tutorial
The Python code below uses selenium to find al the list items, li, on a webpage. Selenium can find an element by name instead of code.
🌐
Endtest
endtest.io › blog › a-practical-guide-for-finding-elements-with-selenium
A practical Guide for Finding Elements with Selenium | Finding elements in Selenium can be tricky, here is practical guide to finding them and a comparison with Endtest. | Endtest
username = driver.find_element_by_class_name("form-control") This means that the you won't be able to locate that Username input with the Class Name locator type, since Selenium will throw an error.
🌐
LambdaTest Community
community.lambdatest.com › general discussions
Finding Element by Name Attribute in Selenium Python - LambdaTest Community
February 22, 2024 - How to find an element by its name attribute using Selenium in Python? Below is my HTML file and code where i am trying to get the attribute name ``` inputElement = driver.find_element_by_id("quantity")
🌐
TechBeamers
techbeamers.com › locate-elements-selenium-python
Python Selenium Locate Elements - TechBeamers
November 30, 2025 - get_div = driver.find_element_by_class_name('round-button') Today, you learned eight locator types and how to use them in Selenium Python.
🌐
LambdaTest
lambdatest.com › blog › how-to-use-name-locator-in-selenium-automation-scripts
How To Use Name Locator In Selenium Automation Scripts? | LambdaTest
April 15, 2024 - A key point to note is when you tend to select an element with a desired name attribute value, it will select the first element it encounters. You may come across another scenario, where you wish to select elements with the same name attribute value, in this case, the By.name locator in Selenium may work using the findElements syntax.
🌐
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 - # With the help of exact text link ... location elements in Selenium with Python: Use Unique Identifiers as they are the most stable and reliable method for element identification....
🌐
Python Examples
pythonexamples.org › python-selenium-find-element-by-class-name
How to find Element by Class Name using Selenium Python
In the Python program, we will find the HTML element whose class name is 'xyz', using find_element() method, and print that element to the console. ... from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.chrome.service import Service ...