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.8.tar.gz
(15.4 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.8-py3-none-any.whl
(15.5 kB
view details)
File details
Details for the file talk2dom-0.2.8.tar.gz.
File metadata
- Download URL: talk2dom-0.2.8.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17b8a5a43f5bad6e91e95534375204cd4d309b239c44a5010553f7e1e47faa33
|
|
| MD5 |
499b0fdf2a52052260e73fd26ffc86fd
|
|
| BLAKE2b-256 |
19d55154fba18492e471b4f40af0b7c2560d3f53dde80e80c283721b5649585e
|
File details
Details for the file talk2dom-0.2.8-py3-none-any.whl.
File metadata
- Download URL: talk2dom-0.2.8-py3-none-any.whl
- Upload date:
- Size: 15.5 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 |
791461141b7d522079df47b5ff9c65581236453f243f02eae98fc00d9ebf9411
|
|
| MD5 |
d99007749eccd96b0b6452a7885e95ea
|
|
| BLAKE2b-256 |
e84a1073d65455bd965e74c1d317cf4f29f5b5c410eb34683f2ea93f29569d92
|