async function scrapeLinks()

in packages/synthetics-sdk-broken-links/src/broken_links.ts [305:321]


async function scrapeLinks(
  originPage: Page,
  options: BrokenLinksResultV1_BrokenLinkCheckerOptions
): Promise<LinkIntermediate[]> {
  // scrape links on originUri
  const retrievedLinks: LinkIntermediate[] = await retrieveLinksFromPage(
    originPage,
    options.query_selector_all,
    options.get_attributes
  );

  return shuffleAndTruncate(
    retrievedLinks,
    options.link_limit!,
    options.link_order
  );
}