Locator Strategies - Selenium Python Last Updated : 12 Jul, 2025 Comments Improve Suggest changes Like Article Like Report Locators Strategies in Selenium Python are methods that are used to locate elements from the page and perform an operation on the same. Selenium’s Python Module is built to perform automated testing with Python. Selenium Python bindings provides a simple API to write functional/acceptance tests using Selenium WebDriver. After one has installed selenium and checked out – Navigating links using get method, one might want to play more with Selenium Python. After opening a page using selenium such as geeksforgeeks, one might want to click some buttons automatically or fill a form automatically or any such automated task. This article revolves around two strategies - Locating Single Elements and Location Multiple Elements. Locator Strategies to locate single first elements Selenium Python follows different locating strategies for elements. One can locate a element in 8 different ways. Here is a list of locating strategies for Selenium in python - LocatorsDescriptionfind_element_by_idThe first element with the id attribute value matching the location will be returned.find_element_by_nameThe first element with the name attribute value matching the location will be returned.find_element_by_xpathThe first element with the xpath syntax matching the location will be returned.find_element_by_link_textThe first element with the link text value matching the location will be returned.find_element_by_partial_link_textThe first element with the partial link text value matching the location will be returned.find_element_by_tag_nameThe first element with the given tag name will be returned.find_element_by_class_namethe first element with the matching class attribute name will be returned.find_element_by_css_selectorThe first element with the matching CSS selector will be returned.Locator Strategies to locate multiple elements Selenium Python follows different locating strategies for elements. One can locate multiple elements in 7 different ways. Here is a list of locating strategies for Selenium in python - LocatorsDescriptionfind_elements_by_nameAll elements with name attribute value matching the location will be returned.find_elements_by_xpathAll elements with xpath syntax matching the location will be returned.find_elements_by_link_textAll elements with link text value matching the location will be returned.find_elements_by_partial_link_textAll elements with partial link text value matching the location will be returned.find_elements_by_tag_nameAll elements with given tag name will be returned.find_elements_by_class_nameAll elements with matching class attribute name will be returned.find_elements_by_css_selectorAll elements with matching CSS selector will be returned. Comment More infoAdvertise with us N NaveenArora Follow Improve Article Tags : Python Python-selenium Practice Tags : python Explore Python FundamentalsPython Introduction 3 min read Input and Output in Python 4 min read Python Variables 5 min read Python Operators 5 min read Python Keywords 2 min read Python Data Types 8 min read Conditional Statements in Python 3 min read Loops in Python - For, While and Nested Loops 7 min read Python Functions 8 min read Recursion in Python 6 min read Python Lambda Functions 5 min read Python Data StructuresPython String 5 min read Python Lists 6 min read Python Tuples 6 min read Dictionaries in Python 7 min read Python Sets 10 min read Python Arrays 9 min read List Comprehension in Python 4 min read Advanced PythonPython OOP Concepts 11 min read Python Exception Handling 6 min read File Handling in Python 4 min read Python Database Tutorial 4 min read Python MongoDB Tutorial 2 min read Python MySQL 9 min read Python Packages 12 min read Python Modules 7 min read Python DSA Libraries 15 min read List of Python GUI Library and Packages 11 min read Data Science with PythonNumPy Tutorial - Python Library 3 min read Pandas Tutorial 6 min read Matplotlib Tutorial 5 min read Python Seaborn Tutorial 15+ min read StatsModel Library- Tutorial 4 min read Learning Model Building in Scikit-learn 8 min read TensorFlow Tutorial 2 min read PyTorch Tutorial 7 min read Web Development with PythonFlask Tutorial 8 min read Django Tutorial | Learn Django Framework 10 min read Django ORM - Inserting, Updating & Deleting Data 4 min read Templating With Jinja2 in Flask 6 min read Django Templates 7 min read Python | Build a REST API using Flask 3 min read How to Create a basic API using Django Rest Framework ? 4 min read Python PracticePython Quiz 3 min read Python Coding Practice 1 min read Python Interview Questions and Answers 15+ min read Like