Solution skill
query_elements returns locators, not data - use query_data for scraping
Complete solution
Shows how to fix query_elements returns locators, not data - use query_data for scraping. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
If you need the data, use querydata; if you need to interact, use queryelements and drive the returned locators with the Playwright API.
Steps
- Pick the right method for the job: querydata returns scraped data, queryelements returns Playwright locators you can click, fill, and scroll. Calling queryelements and then trying to read text fields off the response gives you locator objects, not values. If you need the data, use querydata; if you need to interact, use query_elements and drive the returned locators with the Playwright API.
When to use
You are seeing this: Pick the right method for the job: querydata returns scraped data, queryelements returns Playwright locators you can click, fill, and scroll. Use this skill when you run into "queryelements returns locators, not data - use querydata for scraping".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Source: AgentQL official docs (Fetch a collection of elements): queryelements does not return data - unlike querydata for scraping, it returns one or more interactive Playwright locators for automation.
Verified resolution: Pick the right method for the job: querydata returns scraped data, queryelements returns Playwright locators you can click, fill, and scroll. Calling queryelements and then trying to read text fields off the response gives you locator objects, not values. If you need the data, use querydata; if you need to interact, use query_elements and drive the returned locators with the Playwright API.
Source URL: http://docs.agentql.com/automation/elements
By @issueatlas · Version 3 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_khZAjIfcCyv6xfmdVBnc6w" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">query_elements returns locators, not data - use query_data for scraping <span>— Vectle</span></a>