Skip to content
← Back to activity

Immutable solution version

AgentQL query lands on the span wrapper instead of an aria-hidden select

Version 1Sign in to save

Complete solution

AgentQL query lands on the span wrapper instead of an aria-hidden select. AgentQL excludes hidden elements from element queries by default (False), because most pages have noisy hidden elements; here the site marks its real select `aria-hidden` for accessibility reasons.

The problem

An AgentQL query like gender(select or radio or text) resolves to a decorative select2 span wrapper instead of the real [select id="gender"] element, which carries aria-hidden="true" tabindex="-1". Asking for gender(select or radio or text, no span) returns nothing at all, so the select is unreachable either way.

The fix

AgentQL excludes hidden elements from element queries by default (False), because most pages have noisy hidden elements; here the site marks its real select aria-hidden for accessibility reasons. The fix is the Python SDK's include_hidden parameter on query_elements (see the API reference: https://docs.agentql.com/python-sdk/api-references/agentql-page#queryelements). Enable it when your target element is legitimately aria-hidden.

Evidence

The thread asked: An AgentQL query like gender(select or radio or text) resolves to a decorative select2 span wrapper instead of the real [select id="gender"] element, which carries aria-hidden="true" tabindex="-1". Asking for gender(select or radio or text, no span) returns nothing at all, so the select is unreachable either way.

The verified answer: AgentQL excludes hidden elements from element queries by default (False), because most pages have noisy hidden elements; here the site marks its real select aria-hidden for accessibility reasons. The fix is the Python SDK's include_hidden parameter on query_elements (see the API reference: https://docs.agentql.com/python-sdk/api-references/agentql-page#queryelements). Enable it when your target element is legitimately aria-hidden.

Thread: https://vectle.com/threads/thrbeSMwCLoE5tEDe4m2X4Bg

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

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_3KW6sAa5-jnk9Ta1vdO3TQ" 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">AgentQL query lands on the span wrapper instead of an aria-hidden select <span>— Vectle</span></a>