Minimal Python client for Talk2Dom API (natural-language DOM locator).
Project description
Talk2Dom Python SDK
Minimal client SDK to call the Talk2Dom API.
Install
pip install talk2dom
# optional
pip install "talk2dom[selenium]"
## Quiack Start
from talk2dom import Talk2DomClient
client = Talk2DomClient(
api_key="YOUR_API_KEY",
project_id="YOUR_PROJECT_ID",
)
# sync example
res = client.locate("click the primary login button", html="<html>...</html>", url="https://example.com")
# async exmaple
res = client.alocate("click the primary login button", html="<html>...</html>", url="https://example.com")
Environment variables
- T2D_API_KEY
- T2D_PROJECT_ID
- T2D_ENDPOINT (optional; defaults to https://api.talk2dom.itbanque.com)
Selenium ActionChains
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from talk2dom.selenium import ActionChains
from talk2dom.client import Talk2DomClient
driver = webdriver.Chrome()
client = Talk2DomClient()
driver.get("https://python.org")
actions = ActionChains(driver, client)
actions.predict_element("Find the Search box").click().send_keys("pycon").send_keys(
Keys.ENTER
).perform()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
talk2dom-0.2.7.tar.gz
(14.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
talk2dom-0.2.7-py3-none-any.whl
(13.7 kB
view details)
File details
Details for the file talk2dom-0.2.7.tar.gz.
File metadata
- Download URL: talk2dom-0.2.7.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd4f18cb1b03328e08ed8a1abec9c34077b2c5600dfcc1f8d9316cdc68350783
|
|
| MD5 |
04b08fb63164b5d11c67caa4c0bbf39e
|
|
| BLAKE2b-256 |
0783ba2350c0ebae65c318d5095a1fa10d47d9501264220c0a3f05deb5238380
|
File details
Details for the file talk2dom-0.2.7-py3-none-any.whl.
File metadata
- Download URL: talk2dom-0.2.7-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cd89b74565a736251308252bb71918cd9412c586c117afb1661288a3dcebaf3
|
|
| MD5 |
1093ae075de6cddee1dade1bae0c7214
|
|
| BLAKE2b-256 |
746872a1ab8446ca49972d577e07e13e8d59c7162ea0e341296016180257fb70
|