talk2dom

Find any web element with just one sentence.
Natural language meets browser automation.

โญ๏ธ Star on GitHub ยท Get Started โ†’

๐Ÿ–ฅ Desktop demo

๐Ÿ“ฑ Mobile demo

๐Ÿง  What is talk2dom?

Just describe the element โ€” talk2dom uses an LLM to analyze your current HTML and return the correct selector.

๐Ÿ“ฆ Install

Start using in 10 seconds:

pip install talk2dom

You can use OpenAI, Groq, or any provider supported by LangChain-compatible LLMs.

๐Ÿ†š Before vs After

๐Ÿ”ง Traditional XPath approach

โŒ Before: Manually writing selectors

Manual XPath + fragile By.NAME.

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By

driver = webdriver.Firefox()
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element(By.NAME, "q") # <- traditional locator
elem.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source
driver.close()

๐Ÿง  AI-powered natural language query

โœ… After: Natural language with talk2dom

1 line natural language โ†’ AI selector

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

from talk2dom import ActionChain

driver = webdriver.Chrome()

ActionChain(driver) \
    .open("http://www.python.org") \
    .find("Find the Search box") \
    .type("pycon") \
    .type(Keys.RETURN) \
    .assert_page_not_contains("No results found.") \
    .close()

โœจ Features