The AQLResponseProxy class is returned by the AgentQL's Page's queryElements() method. It's not the actual data but a metadata structure that allows intuitive access to web elements using dot notation. You can convert this class into raw data as a structured dictionary using its toData() method.
To access desired web elements, users can directly use the names defined in queries as attributes of the response object. It returns desired elements as Playwright Locator, and users can interact with these elements, such as click or type, through the Playwright Locator API.
The following example queries for web elements through the queryElements() method, interacts with these elements through AQLResponseProxy objects, and converts AQLResponseProxy objects into raw data.
Example Usage
Methods
toData
Converts the response data into a structured map based on the query tree.
This method is used to access attributes of the response object. If called on an innermost node of the query, it returns the desired web element as a Playwright Locator. Please check the Playwright Locator API for available methods.
If called on a container node of the query, it returns another AQLResponseProxy object.