Skip to main content

Minimal Python client for Talk2Dom API (natural-language DOM locator).

Project description

Talk2Dom Python SDK

PyPI PyPI Downloads Stars License CI

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

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

talk2dom-0.2.7-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

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

Hashes for talk2dom-0.2.7.tar.gz
Algorithm Hash digest
SHA256 bd4f18cb1b03328e08ed8a1abec9c34077b2c5600dfcc1f8d9316cdc68350783
MD5 04b08fb63164b5d11c67caa4c0bbf39e
BLAKE2b-256 0783ba2350c0ebae65c318d5095a1fa10d47d9501264220c0a3f05deb5238380

See more details on using hashes here.

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

Hashes for talk2dom-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 3cd89b74565a736251308252bb71918cd9412c586c117afb1661288a3dcebaf3
MD5 1093ae075de6cddee1dade1bae0c7214
BLAKE2b-256 746872a1ab8446ca49972d577e07e13e8d59c7162ea0e341296016180257fb70

See more details on using hashes here.

Supported by

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