Purpose
Search the Texas Comptroller public entity registry for one or more supplied name variants, preserve a full-page screenshot for each result, and return a structured extraction of the displayed registry results.
When to Use
Use when checking whether an entity name appears in Texas public state-registry records, especially when comparing multiple spelling, spacing, or punctuation variants.
Workflow
- For a supplied
{query}, construct the direct results URLhttps://comptroller.texas.gov/data-search/franchise-tax?name={encodeURIComponent(query)}and navigate to it. This avoids the homepage and native form interaction when the name can be passed in thenamequery parameter. - After the result page renders, save a full-page screenshot before changing the query. Include the query in the screenshot filename, such as
texas-registry-{query-slug}.png. - On the loaded result page, run this evaluator to return the visible search form metadata and tabular registry results:
(() => {
const text = (e) =>
(e?.innerText || e?.textContent || "").replace(/\\s+/g, " ").trim();
const visible = (e) =>
!!e && !!(e.offsetWidth || e.offsetHeight || e.getClientRects().length);
const controls = [...document.querySelectorAll("input,select,textarea,button")]
.filter(visible)
.map((e) => ({
tag: e.tagName.toLowerCase(),
type: e.type || null,
name: e.name || null,
id: e.id || null,
value: e.value || "",
label: (e.labels?.[0]?.innerText || "").trim(),
text: text(e),
}));
const tables = [...document.querySelectorAll("table")]
.filter(visible)
.map((table) => ({
caption: text(table.querySelector("caption")),
headers: [...table.querySelectorAll("thead th, thead td, tr:first-child th")]
.map(text)
.filter(Boolean),
rows: [...table.querySelectorAll("tbody tr, tr")]
.map((tr) =>
[...tr.querySelectorAll(":scope > th, :scope > td")]
.map(text)
.filter(Boolean),
)
.filter((r) => r.length),
}))
.filter((t) => t.rows.length || t.headers.length);
return { url: location.href, title: document.title, controls, tables };
})();- Associate each screenshot and extracted result object with its submitted
{query}; report no matches explicitly when the page shows no result rows. - If the direct URL does not render the expected result state, use the public fallback endpoint
https://mycpa.cpa.state.tx.us/coa/search.do: enter{query}in the registry entity/name field and submit the native form, then screenshot and evaluate the resulting page. For multiple caller-supplied variants, repeat the process independently for each variant.
Site-Specific Gotchas
- The direct Comptroller results route is
https://comptroller.texas.gov/data-search/franchise-tax?name={query}; URL-encode the supplied name, including spaces and punctuation. - The useful fallback public search endpoint is on
mycpa.cpa.state.tx.us, even though the task domain iscomptroller.texas.gov; use it only if the direct query URL fails to produce the result state. - Save a full-page screenshot after the result page has rendered and before changing the query, so the complete displayed result is auditable.
- The observed native form uses
input#nameandbutton#submitBtnwhen the fallback flow is required. - Treat each spelling variant as a separate search and screenshot so punctuation and spacing differences remain auditable.
- The evaluator intentionally relies on semantic form and table elements because no durable result-row IDs were established; verify that a visible result table is present before interpreting rows as registry matches.
- Do not use a login or infer opaque entity identifiers from names.
Expected Output
For every {query}, return the submitted query, screenshot filename, the evaluator's {url, title, controls, tables} object, and a concise match/no-match summary based only on the displayed public results.