Install
openclaw skills install agentqlWeb scraping and browser automation using AgentQL — query any webpage with natural language to extract structured data, interact with elements, and automate browser tasks. Use when asked to scrape, extract data from, or automate interactions on a webpage using natural language queries.
openclaw skills install agentqlAgentQL lets you query webpages with natural language to extract structured data and automate browser interactions. It uses Playwright under the hood.
AgentQL requires an API key. Set it as an environment variable:
export AGENTQL_API_KEY="your-api-key"
Get a free API key at https://dev.agentql.com
import agentql
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
page = agentql.wrap(browser.new_page())
page.goto("https://example.com")
# Query with natural language
response = page.query_data("""
{
title
main_heading
description
}
""")
print(response)
browser.close()
# Create a new script template
agentql new-script scraper.py
# Run it
python3 scraper.py
response = page.query_data("""
{
products[] {
name
price
rating
}
}
""")
response = page.query_elements("""
{
search_box
submit_button
}
""")
response.search_box.fill("query")
response.submit_button.click()
browser = p.chromium.launch(headless=True)
browser = p.chromium.connect_over_cdp("http://127.0.0.1:9222") # Brave/Chrome
page = agentql.wrap(browser.contexts[0].pages[0])
agentql doctor # Check setup
agentql new-script # Generate template script
python3 script.py