Extract links from a webpage
Bun’s HTMLRewriter API extracts links from HTML. Chain CSS selectors to match the elements, text, and attributes you want to process, then pass.transform a Response, Blob, or string.
Convert relative URLs to absolute
When scraping websites, you often want to convert relative URLs (like/docs) to absolute URLs:
See
HTMLRewriter.