A link extractor example turns authorized HTML source into a deduplicated inventory of link targets, one target per line, without requesting any listed destination.

For SEO work, this creates a practical starting point for reviewing the links present in a page’s source. It does not prove that a target is healthy, internal, canonical or reachable. The Link Extractor handles the local parsing step, while status checks, redirect analysis, rel review and dynamic-page inspection require separate authorized tools.

link extractor example
Link Extractor Example: HTML Source to URL List

What the example extracts

A source parser can only report links that appear in the markup supplied to it. Link Extractor scans the start tags of three HTML elements and collects their href attributes:

Start tag Source context What enters the inventory
a An ordinary link to a document or destination. The normalized href target is included, but it is not automatically classified as navigational, internal or external.
area A target associated with an image map. The href target is included without adding a navigation or image-map judgment.
link A resource that may be a stylesheet, icon, canonical page or alternate resource. The href target is included, but the tool does not infer its relationship from the element name.

Absolute HTTP and HTTPS addresses are normalized directly. Mail and telephone targets are also retained because they are legitimate link destinations even though they do not point to ordinary web pages. When an optional HTTP or HTTPS base URL is provided, root-relative, path-relative, parent-relative and scheme-relative values are resolved through the browser URL model. Without a base URL, relative values remain relative so the tool never invents a source host.

The parser also decodes decimal and hexadecimal character references, plus the named references amp, quot, apos, lt and gt inside href values. It is not a complete HTML named-character database, so a rare named reference can remain encoded. Comments and common raw-text containers such as script, style, textarea, title, iframe, noembed and noframes are removed before scanning. This prevents text that resembles link markup from being returned as a false link.

  1. Copy the authorized page source. Use the source view of a page you are permitted to inspect, or obtain HTML through your own crawler. The tool cannot fetch a remote page URL on your behalf.
  2. Paste the HTML into the extraction field. The supplied source is processed locally in the browser. The extraction is based on static markup, so a link inserted after a script runs may not appear in the source.
  3. Add the absolute page URL when relative paths need resolving. The base must begin with HTTP or HTTPS and cannot contain credentials. Leave it empty when you want relative targets preserved as relative values.
  4. Extract the links. Review the one-target-per-line result along with the separate unique, duplicate and skipped counts.
  5. Copy the retained list for an authorized crawl or audit. Keep status, redirects, authentication requirements, robots controls, rel meaning and dynamic DOM links as separate review tasks.

This workflow keeps the source inventory distinct from network validation. The extraction can tell you which href values were found and normalized; it cannot tell you what response a server will return.

See the example resolve and deduplicate

Suppose the base URL is https://example.com/products/page and the pasted source contains these start tags:

href in the source Extraction result
/pricing Resolved against the base URL as https://example.com/pricing.
/pricing again Recognized as a duplicate after normalization and removed from the unique result.
mailto:[email protected] Retained as an email target.
tel:+15551234567 Retained as a telephone target.
#details Skipped because it is a same-document fragment.
javascript:void(0) Skipped because it uses an executable scheme.
data:text/html,example Skipped because it uses an embedded-data scheme.

Shown as list items for readability, the resulting output is:

The expected summary is three unique targets, one duplicate and three skipped values. First-seen order is preserved, which makes it possible to compare the result with source order. Duplicate removal is exact after normalization: two links that resolve to the same absolute address collapse into one entry, but URLs that differ by tracking parameters, case-sensitive paths or other characters are not treated as equivalent.

Interpret the three counts

The counts beside the result explain how the source was filtered. They are processing results, not quality scores.

Count Correct interpretation What it does not establish
Unique Distinct normalized targets retained after exact deduplication. It does not show that each target returns a successful response or represents a unique page in a broader site.
Duplicate Repeated targets removed because their normalized values were identical. It does not identify redirects, tracking variants or semantically equivalent pages.
Skipped Values omitted during filtering, including empty values, fragments, executable or embedded-data schemes and invalid absolute URLs. It does not report failed network requests, blocked pages or authentication errors.

Pay particular attention to the skipped count when the result looks unexpectedly short. It makes the filtering decision visible instead of allowing unsafe or invalid values to disappear silently. Vbscript targets are excluded with other executable schemes, and invalid absolute URLs are also omitted.

Use the list in an SEO review

The extracted list is best treated as a candidate inventory for an authorized review. It can support several practical checks:

  • Seed a crawler with reviewed targets. Use the unique list to organize status and redirect checks. A listed URL may return an error, require authentication, redirect elsewhere or be blocked by robots controls.
  • Review link relationships separately. The extractor does not evaluate rel attributes, identify canonical pages or decide whether a link element represents a stylesheet, preload or alternate resource.
  • Classify destinations in your own report. Internal and external labels are not assigned by the tool, and a target on another domain may be intentional rather than erroneous.
  • Compare source and rendered links. Links created by JavaScript after rendering will not exist in static source. Compare the original source, a browser DOM export and a real crawler when dynamic behavior matters.
  • Keep the output separate from SEO quality. The list records targets; it does not assess content, relevance, link authority or crawl priority.

This distinction is especially important for legal, security or migration audits. A source-derived inventory provides useful coverage of static href values, while a crawler or browser review exposes behavior that a bounded parser cannot reproduce.

Several boundaries affect how complete the example can be:

  • Static source only. The implementation does not execute scripts or render a framework application. A dynamic link may exist in the live page but not in the pasted source.
  • Bounded HTML parsing. The tool is a source scanner rather than a complete browser HTML tree builder. Severely malformed markup, unusual unquoted attributes, missing raw-text closing tags and browser error recovery can produce different results.
  • Defined exclusions. Comments and common raw-text containers are removed before scanning. Template contents are also excluded by the bounded product contract.
  • Input size limit. Pasted HTML is capped at 200,000 characters. Very large documents should be split or handled with a controlled crawler.
  • No remote fetching. The tool cannot retrieve a URL from a remote address. Paste source you obtained through an authorized method instead.

For a high-stakes audit, do not rely on a single extraction channel. Compare the original source with a browser DOM export and a controlled crawler. That comparison can reveal dynamic links and browser-recovery differences without asking the source parser to perform tasks outside its contract.

Local processing and source boundaries

The HTML and extracted targets stay in the browser. Link Extractor never requests the listed destinations, which avoids silently contacting every URL found in pasted source. It also never validates their HTTP status or redirect behavior.

Base URL validation provides another important boundary. Only HTTP and HTTPS bases are accepted, and credential-bearing URLs are rejected. This prevents misleading resolution context and avoids copying user information into every resolved result. With an appropriate base, the example produces absolute addresses for comparison and downstream crawling; without one, it preserves relative values rather than inventing a hostname.

For a deeper look, see How to Get Started With an llms.txt File Example.

For a deeper look, see Extract URLs From a Sitemap Safely: Privacy and Validation.