Skip to main content

Datetime and range slider tools for python selenium

Project description

Selenium-Tools provides the following tools for use with Selenium:

  1. Send/receive datetime.datetime objects from web forms.
  2. Drag range sliders to specified values.


$ pip install selenium-tools


First, clone an example file from the Selenium-Tools repo.

$ curl --output form.html

Let's send the current date and time to all input in the form.

from selenium_tools import get_datetime, send_datetime

from selenium.webdriver import Chrome

from datetime import datetime

driver = Chrome()

datetime_ = datetime.utcnow()

css_selectors = (
for selector in css_selectors:
    input_ = driver.find_element_by_css_selector(selector)
    send_datetime(input_, datetime_)

You'll see the form filled in in your selenium browser and receive the following output in your terminal:

2020-06-30 00:00:00
2020-06-30 15:47:00
2020-06-01 00:00:00
1900-01-01 15:47:00
2020-01-01 00:00:00

We can also drag the range slider as follows:

from selenium_tools import drag_range

range_ = driver.find_element_by_css_selector('input[type=range]')
drag_range(driver, range_, 80)




  author = {Dillon Bowen},
  title = {Selenium-Tools},
  url = {},
  date = {2020-06-29},


Users must cite this package in any publications which use it.

It is licensed with the MIT License.

Project details

Download files

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

Source Distribution

selenium-tools-0.0.2.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

selenium_tools-0.0.2-py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page