Datetime-Selenium allows you to send/retrieve datetime.datetime objects to/from web forms using Selenium.
Installation
$ pip install datetime-selenium
Quickstart
First, clone an example file from the Datetime-Selenium repo.
$ curl https://raw.githubusercontent.com/dsbowen/datetime-selenium/master/form.html --output form.html
Let's send the current date and time to all input in the form.
from datetime_selenium import send_datetime
from selenium.webdriver import Chrome
from datetime import datetime
driver = Chrome()
driver.get('data:text/html,'+open('form.html').read())
datetime_ = datetime.utcnow()
css_selectors = (
'input[type=date]',
'input[type=datetime-local]',
'input[type=month]',
'input[type=time]',
'input[type=week]'
)
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.
Citation
@software{bowen2020datetime-selenium,
author = {Dillon Bowen},
title = {Datetime-Selenium},
url = {https://dsbowen.github.io/datetime-selenium/},
date = {2020-06-29},
}
License
Users must cite this package in any publications which use it.
It is licensed with the MIT License.
Metadata
Release files for datetime-selenium 0.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| datetime-selenium-0.0.0.tar.gz | 2.5 kB | Without provenance | Details for datetime-selenium-0.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| datetime_selenium-0.0.0-py3-none-any.whl | Python 3 | none | any | Details for datetime_selenium-0.0.0-py3-none-any.whl |
Total release size: 6.1 kB
Release files / datetime-selenium-0.0.0.tar.gz
| Download URL | datetime-selenium-0.0.0.tar.gz |
|---|---|
| Size | 2.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8614ab801f683667cdc81d5cf1bb378f1ce9264b5624bae4625d0f6d2f3a0451
|
|
BLAKE2b-256 checksum How to use checksums |
6a70cd150d38a9c90b932aaf1305019b3a01694322098a5b500b4a19474ebf41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8
|
Release files / datetime_selenium-0.0.0-py3-none-any.whl
| Download URL | datetime_selenium-0.0.0-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1ed25a1b47ef0c4dcbd090657ee9d99f96578ed43f2c6d90c91a07541b22c25d
|
|
BLAKE2b-256 checksum How to use checksums |
cfc010660d3a458cb841260280a508d6e3588f1e4db866615e76b292a8738453
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8
|
Security for datetime-selenium 0.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.