JavaScript Example Scripts
Close a cookie dialog
Close a site's dialog for rejecting/accepting cookies with AgentQL.
Close popup windows
Close modals like promotional forms and banners with AgentQL.
Compare product price across multiple websites
Compare product prices across websites with query_data() method with AgentQL.
Get single element by prompt
Use AgentQL's get_by_prompt method to retrieve an element and interact with it.
Use AgentQL with an already open browser
If you don't want to use Playwright's default browser, you can bring your own.
Query a list of items
How to query a list of items on the page with AgentQL.
Login to sites with AgentQL
Use AgentQL to interact with login forms and log into websites.
Run a script in headless browser.
Run the script in headless browser with AgentQL
Save and load authenticated state
Save and load a authenticated state (i.e. signed-in state) with AgentQL
Run script in a stealth mode
How to apply different techniques to lower the risk of being detected by a anti-bot system
Wait for page to load
Wait for the page to load completely before querying the page with AgentQL
Collect pricing data from e-commerce websites
Collect pricing data from an e-commerce website using AgentQL.
Perform sentiment analysis
Perform sentiment analysis on YouTube comments with AgentQL and OpenAI's GPT-3.5 model.
Get an element's XPath
Get XPath of an element that was fetched with AgentQL.
Submit form
Submit form with AgentQL.