Reach the hydrated Puerto Rico corporation registry search page, submit a corporation-name or registry-number query, return rendered corporation result rows, and optionally open the matching entity-information page for structured details.
Use Cases
Use when a task requires searching the Puerto Rico corporation registry by corporation name or registry number and reading the resulting table, especially when the English SPA must be hydrated before controls or results are available. Use the direct entity URL only when the complete entity query identifier is already known; otherwise resolve it from the search results first.
Automation Flow
- Navigate directly to
https://rcp.estado.pr.gov/en/search/resultsand verify that the final host isrcp.estado.pr.govand the route is the English search interface. The site may normalize this to/en/search; continue on the normalized route without navigating again. - Wait for the SPA to hydrate and for the relevant search field to appear.
- In the same browser automation call, use one search mode:
- Name search: fill
input#corporation_name_txtwith{corporation-name}. - Registry-number search: fill
input#registry_number_txtwith{registry-number}. Use the supplied number as-is; do not invent a suffix or entity identifier.
- Submit with
button[type='submit'], wait fortable tbody tr, and evaluate:
(() => {
const rows = [...document.querySelectorAll('table tbody tr')];
const results = rows
.map(row => ({
cells: [...row.querySelectorAll('td')].map(cell => cell.textContent.trim()),
link: (() => { const a = row.querySelector('a[href]'); if (!a) return null; try { return new URL(a.getAttribute('href'), location.href).href; } catch { return a.getAttribute('href'); } })(),
}))
.filter(r => r.cells.length >= 4)
.map(({ cells, link }) => ({
name: cells[0] || '',
status: cells[1] || '',
type: cells[2] || '',
registryNumber: cells[3] || '',
detail: cells[4] || '',
detailUrl: link,
detailId: link ? (new URL(link).searchParams.get('c') || null) : null,
}));
return {
url: location.href,
resultCount: results.length,
results
};
})()- To open a result, read the complete entity identifier from the result link or returned detail URL. Search results can resolve a bare registry number such as
{registry-number}to a hyphenated identifier such as{registry-number}-{entity-suffix}; preserve the complete returned value rather than guessing it. - Navigate directly to
https://rcp.estado.pr.gov/en/entity-information?c={entity-query-id}, wait forh1or the detail headings, and run the structured extractor on the loaded detail page:
(() => {
const clean = value => (value || '').replace(/\s+/g, ' ').trim();
const tables = [...document.querySelectorAll('table')].map(table =>
[...table.querySelectorAll('tr')]
.map(row => [...row.querySelectorAll('th,td')].map(cell => clean(cell.textContent)))
.filter(cells => cells.length)
);
const labeled = {};
document.querySelectorAll('dl').forEach(dl => {
[...dl.querySelectorAll('dt')].forEach(term => {
const value = term.nextElementSibling;
if (value) labeled[clean(term.textContent)] = clean(value.textContent);
});
});
document.querySelectorAll('table tr').forEach(row => {
const cells = [...row.querySelectorAll('th,td')];
if (cells.length === 2) labeled[clean(cells[0].textContent)] = clean(cells[1].textContent);
});
return {
url: location.href,
title: clean(document.querySelector('h1')?.textContent),
fields: labeled,
tables,
text: clean(document.querySelector('main')?.innerText || document.body.innerText)
};
})()Possible Friction Points
- This is a client-rendered SPA; the initial document can be present before the search controls are usable. Allow about 6 seconds after navigation before interacting or evaluating.
- The shortest observed English route is
/en/search/results;/en/searchis a normalized/intermediate English route, and/es/search/redirects or transitions to the English search route. Avoid the Spanish entry route when English is acceptable. - The corporation-name field uses the stable selector
input#corporation_name_txt, the registry-number field usesinput#registry_number_txt, and the search action usesbutton[type='submit']. - After submission, allow roughly 7–10 seconds for result rendering before extraction.
- Results are table-based and should be read from
table tbody tr; ignore rows with fewer than fourtdcells. The first five columns correspond to name, status, type, registry number, and optional detail. - No reliable query-parameter shortcut was observed for submitting a name or registry-number search; use the hydrated form flow.
- Once the complete entity query identifier is known, the entity detail route follows
/en/entity-information?c={entity-query-id}. Thecvalue may contain a hyphenated suffix and must be copied from the result link or returned result data. - For name-only requests, resolve the entity by searching first and reading the registry identifier from the result row or link before using the entity-information URL; never infer an opaque identifier from the corporation name.
- The detail page exposes visible information through headings, definition-list pairs, and two-column table rows; the detail extractor collects all three while retaining full visible page text for source validation.
Example Result
{
"url": "https://example.com/page",
"title": "Example Title",
"fields": {
"Example Label": "Example Value"
},
"tables": [
[
[
"Example Header",
"Example Value"
]
]
],
"text": "Example page text"
}