selenium


Nameselenium JSON
Version 4.35.0 PyPI version JSON
download
home_pagehttps://www.selenium.dev
SummaryOfficial Python bindings for Selenium WebDriver
upload_time2025-08-12 15:46:40
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ======================
Selenium Client Driver
======================

Introduction
============

Python language bindings for Selenium WebDriver.

The `selenium` package is used to automate web browser interaction from Python.

+-------------------+------------------------------------------------+
| **Home**:         | https://selenium.dev                           |
+-------------------+------------------------------------------------+
| **GitHub**:       | https://github.com/SeleniumHQ/Selenium         |
+-------------------+------------------------------------------------+
| **PyPI**:         | https://pypi.org/project/selenium              |
+-------------------+------------------------------------------------+
| **IRC/Slack**:    | https://www.selenium.dev/support/#ChatRoom     |
+-------------------+------------------------------------------------+
| **Docs**:         | https://www.selenium.dev/selenium/docs/api/py  |
+-------------------+------------------------------------------------+
| **API Docs**:     | `api.html <api.html>`_                         |
+-------------------+------------------------------------------------+

Updated documentation published with each commit is available at: `readthedocs.io <https://selenium-python-api-docs.readthedocs.io/en/latest>`_

----

Supported Python Versions
=========================

* Python 3.9+

Supported Browsers
==================

Several browsers are supported, as well as the Remote protocol:

* Chrome
* Edge
* Firefox
* Safari
* WebKitGTK
* WPEWebKit

Installing
==========

Install or upgrade the Python bindings with `pip <https://pip.pypa.io/>`.

Latest official release::

    pip install -U selenium

Nightly development release::

    pip install -U --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ selenium

Note: you should consider using a
`virtual environment <https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments>`_
to create an isolated Python environment for installation.

Drivers
=======

Selenium requires a driver to interface with the chosen browser (chromedriver, edgedriver, geckodriver, etc).

In older versions of Selenium, it was necessary to install and manage these drivers yourself. You had to make sure the
driver executable was available on your system `PATH`, or specified explicitly in code. Modern versions of Selenium
handle browser and driver installation for you with
`Selenium Manager <https://www.selenium.dev/documentation/selenium_manager>`_. You generally don't have to worry about
driver installation or configuration now that it's done for you when you instantiate a WebDriver. Selenium Manager works
with most supported platforms and browsers. If it doesn't meet your needs, you can still install and specify browsers
and drivers yourself.

Links to some of the more popular browser drivers:

+--------------+-----------------------------------------------------------------------+
| **Chrome**:  | https://developer.chrome.com/docs/chromedriver                        |
+--------------+-----------------------------------------------------------------------+
| **Edge**:    | https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver  |
+--------------+-----------------------------------------------------------------------+
| **Firefox**: | https://github.com/mozilla/geckodriver                                |
+--------------+-----------------------------------------------------------------------+
| **Safari**:  | https://webkit.org/blog/6900/webdriver-support-in-safari-10           |
+--------------+-----------------------------------------------------------------------+

Example 0:
==========

* launch a new Chrome browser
* load a web page
* close the browser

.. code-block:: python

    from selenium import webdriver


    driver = webdriver.Chrome()
    driver.get('https://selenium.dev/')
    driver.quit()

Example 1:
==========

* launch a new Chrome browser
* load the Selenium documentation page
* find the "Webdriver" link
* click the "WebDriver" link
* close the browser

.. code-block:: python

    from selenium import webdriver
    from selenium.webdriver.common.by import By


    driver = webdriver.Chrome()

    driver.get('https://selenium.dev/documentation')
    assert 'Selenium' in driver.title

    elem = driver.find_element(By.ID, 'm-documentationwebdriver')
    elem.click()
    assert 'WebDriver' in driver.title

    driver.quit()

Example 2:
==========

Selenium WebDriver is often used as a basis for testing web applications. Here is a simple example using Python's
standard `unittest <http://docs.python.org/3/library/unittest.html>`_ library:

.. code-block:: python

    import unittest
    from selenium import webdriver


    class GoogleTestCase(unittest.TestCase):

        def setUp(self):
            self.driver = webdriver.Firefox()
            self.addCleanup(self.driver.quit)

        def test_page_title(self):
            self.driver.get('https://www.google.com')
            self.assertIn('Google', self.driver.title)

    if __name__ == '__main__':
        unittest.main(verbosity=2)

Selenium Grid (optional)
==========================

For local Selenium scripts, the Java server is not needed.

To use Selenium remotely, you need to also run a Selenium Grid. For information on running Selenium Grid:
https://www.selenium.dev/documentation/grid/getting_started/

To use Remote WebDriver see: https://www.selenium.dev/documentation/webdriver/drivers/remote_webdriver/?tab=python

Use The Source Luke!
====================

View source code online:

+---------------+-------------------------------------------------------+
| **Official**: | https://github.com/SeleniumHQ/selenium/tree/trunk/py  |
+---------------+-------------------------------------------------------+

Contributing
=============

 - Fork the selenium repo
 - Clone your fork locally
 - Create a branch for your work
     - `git checkout -b my-cool-branch-name`
 - Create a virtual environment and install tox
     - `python -m venv venv && source venv/bin/activate && pip install tox`
 - Make your changes
 - Run the linter/formatter
     - `tox -e linting`
 - If tox exits `0`, commit and push. Otherwise, fix the newly introduced style violations
 - Submit a Pull Request


            

Raw data

            {
    "_id": null,
    "home_page": "https://www.selenium.dev",
    "name": "selenium",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/75/67/9016942b5781843cfea6f5bc1383cea852d9fa08f85f55a0547874525b5c/selenium-4.35.0.tar.gz",
    "platform": null,
    "description": "======================\nSelenium Client Driver\n======================\n\nIntroduction\n============\n\nPython language bindings for Selenium WebDriver.\n\nThe `selenium` package is used to automate web browser interaction from Python.\n\n+-------------------+------------------------------------------------+\n| **Home**:         | https://selenium.dev                           |\n+-------------------+------------------------------------------------+\n| **GitHub**:       | https://github.com/SeleniumHQ/Selenium         |\n+-------------------+------------------------------------------------+\n| **PyPI**:         | https://pypi.org/project/selenium              |\n+-------------------+------------------------------------------------+\n| **IRC/Slack**:    | https://www.selenium.dev/support/#ChatRoom     |\n+-------------------+------------------------------------------------+\n| **Docs**:         | https://www.selenium.dev/selenium/docs/api/py  |\n+-------------------+------------------------------------------------+\n| **API Docs**:     | `api.html <api.html>`_                         |\n+-------------------+------------------------------------------------+\n\nUpdated documentation published with each commit is available at: `readthedocs.io <https://selenium-python-api-docs.readthedocs.io/en/latest>`_\n\n----\n\nSupported Python Versions\n=========================\n\n* Python 3.9+\n\nSupported Browsers\n==================\n\nSeveral browsers are supported, as well as the Remote protocol:\n\n* Chrome\n* Edge\n* Firefox\n* Safari\n* WebKitGTK\n* WPEWebKit\n\nInstalling\n==========\n\nInstall or upgrade the Python bindings with `pip <https://pip.pypa.io/>`.\n\nLatest official release::\n\n    pip install -U selenium\n\nNightly development release::\n\n    pip install -U --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ selenium\n\nNote: you should consider using a\n`virtual environment <https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments>`_\nto create an isolated Python environment for installation.\n\nDrivers\n=======\n\nSelenium requires a driver to interface with the chosen browser (chromedriver, edgedriver, geckodriver, etc).\n\nIn older versions of Selenium, it was necessary to install and manage these drivers yourself. You had to make sure the\ndriver executable was available on your system `PATH`, or specified explicitly in code. Modern versions of Selenium\nhandle browser and driver installation for you with\n`Selenium Manager <https://www.selenium.dev/documentation/selenium_manager>`_. You generally don't have to worry about\ndriver installation or configuration now that it's done for you when you instantiate a WebDriver. Selenium Manager works\nwith most supported platforms and browsers. If it doesn't meet your needs, you can still install and specify browsers\nand drivers yourself.\n\nLinks to some of the more popular browser drivers:\n\n+--------------+-----------------------------------------------------------------------+\n| **Chrome**:  | https://developer.chrome.com/docs/chromedriver                        |\n+--------------+-----------------------------------------------------------------------+\n| **Edge**:    | https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver  |\n+--------------+-----------------------------------------------------------------------+\n| **Firefox**: | https://github.com/mozilla/geckodriver                                |\n+--------------+-----------------------------------------------------------------------+\n| **Safari**:  | https://webkit.org/blog/6900/webdriver-support-in-safari-10           |\n+--------------+-----------------------------------------------------------------------+\n\nExample 0:\n==========\n\n* launch a new Chrome browser\n* load a web page\n* close the browser\n\n.. code-block:: python\n\n    from selenium import webdriver\n\n\n    driver = webdriver.Chrome()\n    driver.get('https://selenium.dev/')\n    driver.quit()\n\nExample 1:\n==========\n\n* launch a new Chrome browser\n* load the Selenium documentation page\n* find the \"Webdriver\" link\n* click the \"WebDriver\" link\n* close the browser\n\n.. code-block:: python\n\n    from selenium import webdriver\n    from selenium.webdriver.common.by import By\n\n\n    driver = webdriver.Chrome()\n\n    driver.get('https://selenium.dev/documentation')\n    assert 'Selenium' in driver.title\n\n    elem = driver.find_element(By.ID, 'm-documentationwebdriver')\n    elem.click()\n    assert 'WebDriver' in driver.title\n\n    driver.quit()\n\nExample 2:\n==========\n\nSelenium WebDriver is often used as a basis for testing web applications. Here is a simple example using Python's\nstandard `unittest <http://docs.python.org/3/library/unittest.html>`_ library:\n\n.. code-block:: python\n\n    import unittest\n    from selenium import webdriver\n\n\n    class GoogleTestCase(unittest.TestCase):\n\n        def setUp(self):\n            self.driver = webdriver.Firefox()\n            self.addCleanup(self.driver.quit)\n\n        def test_page_title(self):\n            self.driver.get('https://www.google.com')\n            self.assertIn('Google', self.driver.title)\n\n    if __name__ == '__main__':\n        unittest.main(verbosity=2)\n\nSelenium Grid (optional)\n==========================\n\nFor local Selenium scripts, the Java server is not needed.\n\nTo use Selenium remotely, you need to also run a Selenium Grid. For information on running Selenium Grid:\nhttps://www.selenium.dev/documentation/grid/getting_started/\n\nTo use Remote WebDriver see: https://www.selenium.dev/documentation/webdriver/drivers/remote_webdriver/?tab=python\n\nUse The Source Luke!\n====================\n\nView source code online:\n\n+---------------+-------------------------------------------------------+\n| **Official**: | https://github.com/SeleniumHQ/selenium/tree/trunk/py  |\n+---------------+-------------------------------------------------------+\n\nContributing\n=============\n\n - Fork the selenium repo\n - Clone your fork locally\n - Create a branch for your work\n     - `git checkout -b my-cool-branch-name`\n - Create a virtual environment and install tox\n     - `python -m venv venv && source venv/bin/activate && pip install tox`\n - Make your changes\n - Run the linter/formatter\n     - `tox -e linting`\n - If tox exits `0`, commit and push. Otherwise, fix the newly introduced style violations\n - Submit a Pull Request\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Official Python bindings for Selenium WebDriver",
    "version": "4.35.0",
    "project_urls": {
        "Homepage": "https://www.selenium.dev"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "17efd0e033e1b3f19a0325ce03863b68d709780908381135fc0f9436dea76a7b",
                "md5": "0618b6e445f6d214d633fb37e10e411b",
                "sha256": "90bb6c6091fa55805785cf1660fa1e2176220475ccdb466190f654ef8eef6114"
            },
            "downloads": -1,
            "filename": "selenium-4.35.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0618b6e445f6d214d633fb37e10e411b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 9602106,
            "upload_time": "2025-08-12T15:46:38",
            "upload_time_iso_8601": "2025-08-12T15:46:38.244931Z",
            "url": "https://files.pythonhosted.org/packages/17/ef/d0e033e1b3f19a0325ce03863b68d709780908381135fc0f9436dea76a7b/selenium-4.35.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "75679016942b5781843cfea6f5bc1383cea852d9fa08f85f55a0547874525b5c",
                "md5": "59e5e98cb1e03acf8a360bf8cffc94ec",
                "sha256": "83937a538afb40ef01e384c1405c0863fa184c26c759d34a1ebbe7b925d3481c"
            },
            "downloads": -1,
            "filename": "selenium-4.35.0.tar.gz",
            "has_sig": false,
            "md5_digest": "59e5e98cb1e03acf8a360bf8cffc94ec",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 907991,
            "upload_time": "2025-08-12T15:46:40",
            "upload_time_iso_8601": "2025-08-12T15:46:40.822542Z",
            "url": "https://files.pythonhosted.org/packages/75/67/9016942b5781843cfea6f5bc1383cea852d9fa08f85f55a0547874525b5c/selenium-4.35.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-12 15:46:40",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "selenium"
}
        
Elapsed time: 2.54223s