Skip to main content

Python bindings for Selenium

Project description

Author: Miki Tebeka <miki@saucelabs.com>

Selenium Python Client Driver is a Python language binding for Selenium Remote Control (version 1.0 and 2.0).

Currently the remote protocol, Firefox and Chrome for Selenium 2.0 are supported, as well as the Selenium 1.0 bindings. As work will progresses we’ll add more “native” drivers.

See here for more information.

Installing

Python Client

pip install -U selenium

Java Server

Download the server from http://selenium.googlecode.com/files/selenium-server-standalone-2.0a4.jar

java -jar selenium-server-standalone-2.0a4.jar

Example

from selenium.remote import connect
from selenium import FIREFOX
from selenium.common.exceptions import NoSuchElementException
from time import sleep

browser = connect(FIREFOX) # Get local session of firefox
browser.get("http://www.yahoo.com") # Load page
assert browser.get_title() == "Yahoo!"
elem = browser.find_element_by_name("p") # Find the query box
elem.send_keys("selenium\n")
sleep(0.2) # Let the page load, will be added to the API
try:
    browser.find_element_by_xpath("//a[contains(@href,'http://seleniumhq.org')]")
except NoSuchElementException:
    assert 0, "can't find seleniumhq"
browser.close()

Documentation

Coming soon, in the meantime - “Use the source Luke”

Project details


Release history Release notifications

History Node

3.13.0

History Node

3.12.0

History Node

3.11.0

History Node

3.10.0

History Node

3.9.0

History Node

3.8.1

History Node

3.8.0

History Node

3.7.0

History Node

3.6.0

History Node

3.5.0

History Node

3.4.3

History Node

3.4.2

History Node

3.4.1

History Node

3.4.0

History Node

3.3.3

History Node

3.3.2

History Node

3.3.1

History Node

3.3.0

History Node

3.0.2

History Node

3.0.1

History Node

3.0.0

History Node

3.0.0b3

History Node

3.0.0b2

History Node

3.0.0b1

History Node

2.53.6

History Node

2.53.5

History Node

2.53.4

History Node

2.53.3

History Node

2.53.2

History Node

2.53.1

History Node

2.53.0

History Node

2.52.0

History Node

2.51.1

History Node

2.51.0

History Node

2.50.1

History Node

2.50.0

History Node

2.49.2

History Node

2.49.1

History Node

2.49.0

History Node

2.48.0

History Node

2.47.3

History Node

2.47.2

History Node

2.47.1

History Node

2.47.0

History Node

2.46.1

History Node

2.46.0

History Node

2.45.0

History Node

2.44.0

History Node

2.43.0

History Node

2.42.1

History Node

2.42.0

History Node

2.41.0

History Node

2.40.0

History Node

2.39.0

History Node

2.38.4

History Node

2.38.3

History Node

2.38.2

History Node

2.38.1

History Node

2.38.0

History Node

2.37.2

History Node

2.37.1

History Node

2.37.0

History Node

2.36.0

History Node

2.35.0

History Node

2.34.0

History Node

2.33.0

History Node

2.32.0

History Node

2.31.0

History Node

2.30.0

History Node

2.29.0

History Node

2.28.0

History Node

2.27.0

History Node

2.26.0

History Node

2.25.0

History Node

2.24.0

History Node

2.23.0

History Node

2.22.1

History Node

2.22.0

History Node

2.21.3

History Node

2.21.2

History Node

2.21.1

History Node

2.21.0

History Node

2.20.0

History Node

2.19.1

History Node

2.19.0

History Node

2.18.1

History Node

2.17.0

History Node

2.16.0

History Node

2.15.0

History Node

2.14.0

History Node

2.13.1

History Node

2.13.0

History Node

2.12.1

History Node

2.12.0

History Node

2.11.1

History Node

2.11.0

History Node

2.10.0

History Node

2.9.0

History Node

2.8.1

History Node

2.8.0

History Node

2.7.0

History Node

2.6.0

History Node

2.5.0

History Node

2.4.0

History Node

2.3.0

History Node

2.2.0

History Node

2.1.0

History Node

2.0.1

History Node

2.0.0

History Node

2.0rc3

History Node

2.0rc2

History Node

2.0rc1

History Node

2.0b4dev

History Node

2.0b3

History Node

2.0b3dev

History Node

2.0b2

History Node

2.0a5

History Node

2.0-dev-9429

History Node

2.0-dev-9341

History Node

2.0-dev-9340

History Node

2.0-dev-9338

History Node

2.0-dev-9310

History Node

2.0-dev-9307

History Node

2.0-dev-9306

History Node

2.0-dev-9284

History Node

2.0-dev-9231

History Node

2.0-dev-9212

History Node

2.0-dev-9138

History Node

2.0dev6

History Node

2.0dev5

History Node

2.0dev4

History Node

2.0dev3

History Node

2.0dev2

This version
History Node

2.0dev1

History Node

2.0-dev

History Node

1.0.3

History Node

1.0.1

History Node

0.9.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
selenium-2.0dev1.tar.gz (841.8 kB) Copy SHA256 hash SHA256 Source None Feb 14, 2011

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page