Skip to main content

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]"
# or
pip install "talk2dom[playwright]"
## 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

import time
from talk2dom.selenium import ActionChains

driver = webdriver.Chrome()

driver.get("https://python.org")

actions = ActionChains(driver)

actions\
    .go("Type 'pycon' in the search box")\
    .go("Click the 'go' button")

time.sleep(2)

Playwright PageNavigator

from playwright.sync_api import sync_playwright
from talk2dom.playwright import PageNavigator


def main():
    with sync_playwright() as p:
        # Launch Chromium browser
        browser = p.chromium.launch(headless=False)
        page = browser.new_page()

        navigator = PageNavigator(page)

        # Navigate to python.org
        page.goto("https://www.python.org")

        navigator.go("Type 'pycon' in the search box")

        navigator.go("Click the 'go' button")

        # Wait for results to load
        page.wait_for_timeout(3000)

        # Close the browser
        browser.close()


if __name__ == "__main__":
    main()

Metadata

Release files for talk2dom 0.3.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for talk2dom 0.3.5
File Size Uploaded
talk2dom-0.3.5.tar.gz 16.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for talk2dom 0.3.5
File Interpreter ABI Platform
talk2dom-0.3.5-py3-none-any.whl Python 3 none any Details

Total release size: 32.8 kB

Release files / talk2dom-0.3.5.tar.gz

Download URL talk2dom-0.3.5.tar.gz
Size 16.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9cf731407fc2c7c906fa1c9eaabcbde61847bbbf7da6e8a483ba196b323942de
BLAKE2b-256 checksum
How to use checksums
565c70feb90742b471f3208798566be66a0bbb75d96d483844cf8f04d530e914
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release files / talk2dom-0.3.5-py3-none-any.whl

Download URL talk2dom-0.3.5-py3-none-any.whl
Size 16.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f4bb73effc66436f6a0ec7b0cfb0739431cd64b0af6825f0b7af71684851bf6
BLAKE2b-256 checksum
How to use checksums
33aaddca61543df10f87f90c69f74e9925cc4d0254f80fcccb6dd62e20e281cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release history Release notifications | RSS feed

This release

0.3.5 This release

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page