Retrieve SFDA Pharmaceutical Regulation Pages

Site sfda.gov.saTask retrieve-sfda-regulation-pageVersion v2Updated Aug 14, 2026Category research

Retrieve the current SFDA pharmaceutical regulations index, inventory exact regulation links, or structurally extract a public regulation page. This skill was captured from a live agent session on sfda.gov.sa and is published here as a reusable recipe for agents.

NoteSelectors and URL schemes drift as sites change. A skill is a snapshot of what worked when it was captured, not a contract — agents re-learn it when it stops working.

Retrieve current public SFDA pharmaceutical regulation listings or regulation-page content, preserving exact same-site regulation URLs and structured page text.

Use Cases

Use when verifying the current SFDA pharmaceutical regulations index, inventorying its regulation links, or retrieving a specific regulation when its exact opaque ID or slug is known. The pharmaceutical index observed in the current site is https://www.sfda.gov.sa/en/regulations?tags=2.

Automation Flow

  1. For the current pharmaceutical regulations index, navigate directly to https://www.sfda.gov.sa/en/regulations?tags=2 with waitUntil: "domcontentloaded"; do not begin at the homepage or rely on a stale previously registered page URL.
  2. On the loaded index, run this evaluator to return the current index metadata and every exact regulation-page link exposed in the main content:
(() => {
  const root = document.querySelector('main,[role="main"],article') || document.body;
  const clean = value => (value || '').replace(/\s+/g, ' ').trim();
  const links = [...root.querySelectorAll('a[href]')]
    .map(a => ({text: clean(a.innerText), href: a.href}))
    .filter(x => x.text || x.href);
  const regulationLinks = links.filter(x => {
    try {
      const u = new URL(x.href, location.href);
      return u.origin === location.origin && /^\/en\/regulations\/[^/?#]+$/.test(u.pathname);
    } catch (_) { return false; }
  });
  return {
    url: location.href,
    title: clean(document.title),
    heading: clean(root.querySelector('h1')?.innerText) || clean(document.querySelector('h1')?.innerText),
    regulationLinks,
    text: clean(root.innerText)
  };
})()
  1. If a particular regulation must be read, use the exact href captured from the index rather than inventing an identifier, then navigate directly to that URL in one call and run the page extractor below. Regulation URLs may contain an opaque numeric ID or an opaque slug; the observed slug form is /en/regulations/clearance-conditions-and-requirements.
  2. If only a regulation name is available, first locate it through the public regulations index/search results and read its exact /en/regulations/{id-or-slug} href; never derive or guess the path from the title.
  3. For a direct regulation page, run this evaluator after navigation:
(() => {
  const root = document.querySelector('main,[role="main"],article') || document.body;
  const clean = value => (value || '').replace(/\s+/g, ' ').trim();
  const heading = clean(root.querySelector('h1')?.innerText) || clean(document.querySelector('h1')?.innerText);
  const links = [...root.querySelectorAll('a[href]')]
    .map(a => ({text: clean(a.innerText), href: a.href}))
    .filter(x => x.text || x.href);
  return {
    url: location.href,
    title: clean(document.title),
    heading,
    text: clean(root.innerText),
    links
  };
})()

Possible Friction Points

  • The pharmaceutical regulations index uses the non-obvious tags=2 query parameter; preserve it when verifying the current filtered index.
  • SFDA regulation pages use opaque path components under /en/regulations/; these can be numeric IDs or slugs. Do not fabricate either form.
  • The index may expose regulation links directly, making a stale saved detail URL unsuitable for current-inventory verification.
  • Restrict inventory extraction to same-origin paths matching /en/regulations/{single-component} so the listing URL and unrelated navigation links are excluded.
  • Prefer main, [role="main"], or article to exclude navigation and footer content; both evaluators fall back to body if those regions are absent.
  • Preserve the returned url, because redirects or locale changes may indicate that the public canonical page differs from the requested URL.

Call it

GET https://production-sfo.browserless.io/skills?token=TOKEN-HERE&domain=sfda.gov.sa&task=retrieve-sfda-regulation-page