A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/python/selenium-python-introduction-and-installation/ below:

Selenium Python Introduction and Installation

Selenium Python Introduction and Installation

Last Updated : 12 Jul, 2025

Selenium's Python Module is built to perform automated testing with Python. Selenium in Python bindings provides a simple API to write functional/acceptance tests using Selenium WebDriver. Through Selenium Python API you can access all functionalities of python selenium webdriver intuitively.

To check more details about Selenium visit - Selenium Basics – Components, Features, Uses, and Limitations .

Python Selenium Introduction

Selenium Python bindings provide a convenient API to access Selenium Web-Drivers like Firefox, Chrome, Remote, etc. Selenium released its latest version 4.5.0. The current supported Python versions are 3.7 and above.

Selenium's Python Module provides a powerful and intuitive API for automated testing, enabling you to write functional tests using Selenium WebDriver across various browsers and operating systems. With its open-source nature, portability, and support for parallel test execution, Selenium stands out as a highly efficient tool for reducing test execution time and resource requirements. To fully harness these capabilities and advance your testing expertise, consider exploring the Complete Guide to Software Testing & Automation by GeeksforGeeks , which offers comprehensive insights into both basic and advanced Selenium features.

Python Selenium Installation

For any operating system, Selenium Installation can be done on your operating system. If not, check out - Download and Install Python 3 Latest Version

Open Terminal/Cmd and Write Command as written Below

python -m pip install selenium

Alternatively, you can download the source distribution Here , unarchive it, and run the command below:

python setup.py install
Installing Webdriver

One Can Install Firefox, Chromium, PhantomJs (Deprecated Now), etc.

In this article, Firefox is used so One can Follow the Below Steps to Install:

Selenium Installation on Windows

Step 1. Same as Step 1 in Linux Download the GeckoDriver .
Step 2. Extract it using WinRar or any application you may have.
Step 3. Add it to Path using Command Prompt.

setx path "%path%;GeckoDriver Path"

For Example

setx path "%path%;c:/user/eliote/Desktop/geckodriver-v0.26.0-win64/geckodriver.exe"

Selenium Installation on Linux

Step 1. Go to the geckodriver releases page . Find the latest version of the driver for your platform and download it.

For example

wget https://objects.githubusercontent.com/github-production-release-asset-2e65be/25354393/113b5380-234f-11e9-8f1e-2eff36d0eff4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20250712%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250712T105626Z&X-Amz-Expires=1800&X-Amz-Signature=3f6a66aed8adb83eae98130ce23d137eb2cbb3297660c1d565e603844d5a6429&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dgeckodriver-v0.24.0-linux64.tar.gz&response-content-type=application%2Foctet-stream

Step 2. Extract the file.

tar -xvzf geckodriver*

Step 3. Make it executable.

chmod +x geckodriver

Step 4. Move Files to usr/local/bin

sudo mv geckodriver /usr/local/bin/

Creating Simple Code for Python
# Python program to demonstrate
# selenium

# import webdriver
from selenium import webdriver

# create webdriver object
driver = webdriver.Firefox()
# get google.co.in
service = Service(ChromeDriverManager().install())
options = webdriver.ChromeOptions()
driver = webdriver.Chrome(service=service, options=options)

try:
    # Open Google
    driver.get("https://www.google.com/")
finally:
    # Close the browser
    driver.quit()

Output

Selenium Python example solution output Conclusion

Selenium's Python module is an open-source and portable web testing framework that provides a user-friendly API for accessing various WebDrivers like Firefox and Chrome . The latest version, Selenium 4.5.0 , supports Python 3.7 and above. It combines tools and Domain Specific Language (DSL) to facilitate a variety of tests, with commands organized for ease of use . Selenium supports parallel test execution , reducing execution time and increasing efficiency, and it requires fewer resources compared to competitors.



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4