HTML link extractor
List every link and image in HTML, with link text, resolved address, rel values and internal or external.
Input
Result
Fill in the input and press Run.
Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.
Use it from code or an agent
curl -s https://setget.net/v1/tools/html-extract-links \
-H 'Content-Type: application/json' \
-d '{"input":{"text":"<a href=\"/about\">About us</a> <a href=\"https://other.example/\" rel=\"nofollow noopener\">Partner</a><img src=\"logo.png\"><img src=\"team.jpg\" alt=\"The team\">","base_url":"https://example.com/blog/"}}'
import json, urllib.request
body = {'input': {'text': '<a href="/about">About us</a> <a href="https://other.example/" rel="nofollow noopener">Partner</a><img src="logo.png"><img src="team.jpg" alt="The team">', 'base_url': 'https://example.com/blog/'}}
request = urllib.request.Request("https://setget.net/v1/tools/html-extract-links", json.dumps(body).encode(),
{"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/html-extract-links", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({"input":{"text":"<a href=\"/about\">About us</a> <a href=\"https://other.example/\" rel=\"nofollow noopener\">Partner</a><img src=\"logo.png\"><img src=\"team.jpg\" alt=\"The team\">","base_url":"https://example.com/blog/"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
"slug": "html-extract-links",
"input": {
"text": "<a href=\"/about\">About us</a> <a href=\"https://other.example/\" rel=\"nofollow noopener\">Partner</a><img src=\"logo.png\"><img src=\"team.jpg\" alt=\"The team\">",
"base_url": "https://example.com/blog/"
}
}
{
"input": {
"text": "<a href=\"/about\">About us</a> <a href=\"https://other.example/\" rel=\"nofollow noopener\">Partner</a><img src=\"logo.png\"><img src=\"team.jpg\" alt=\"The team\">",
"base_url": "https://example.com/blog/"
}
}
Endpoint: POST /v1/tools/html-extract-links. Over MCP: run_tool with slug: "html-extract-links".
Machine-readable: input schema, Markdown. Connect an agent.
Inputs
| Name | Type | Required | What it does |
|---|---|---|---|
text |
string | yes | The HTML to scan. |
base_url |
string | no | The address of the page, used to resolve relative links and to tell internal from external. |
Example
Input
{
"text": "<a href=\"/about\">About us</a> <a href=\"https://other.example/\" rel=\"nofollow noopener\">Partner</a><img src=\"logo.png\"><img src=\"team.jpg\" alt=\"The team\">",
"base_url": "https://example.com/blog/"
}Result
{
"links": [
{
"text": "About us",
"href": "/about",
"url": "https://example.com/about",
"rel": [],
"nofollow": false,
"kind": "internal"
},
{
"text": "Partner",
"href": "https://other.example/",
"url": "https://other.example/",
"rel": [
"nofollow",
"noopener"
],
"nofollow": true,
"kind": "external"
}
],
"images": [
{
"src": "logo.png",
"url": "https://example.com/blog/logo.png",
"alt": null,
"missing_alt": true
},
{
"src": "team.jpg",
"url": "https://example.com/blog/team.jpg",
"alt": "The team",
"missing_alt": false
}
],
"counts": {
"links": 2,
"internal": 1,
"external": 1,
"images": 2,
"images_missing_alt": 1
},
"truncated": false
}Questions
- What are the link kinds?
- internal (same site as base_url, ignoring a leading www.), external, anchor (starts with #), other (mailto:, tel:, javascript: and similar) and unknown (an absolute link when no base_url was given).
- Is alt="" reported as missing?
- No. An empty alt is the correct way to mark a decorative image. Only images with no alt attribute are flagged.
- Are the links checked?
- No. Nothing is requested, so broken links are not detected.
Related tools
- HTML to plain textExtract readable plain text from HTML: headings, paragraphs, list bullets and table rows, without scripts or menus.
html-to-text - Open Graph and meta tag extractorPull the title, description, canonical link, Open Graph, Twitter card, favicons and JSON-LD out of HTML.
og-tags-extract - URL joinerResolve relative links such as ../page or ?q=1 against a base URL, following RFC 3986.
url-join - robots.txt testerCheck which URL paths a robots.txt file allows for a crawler, and which rule decided, following RFC 9309.
robots-test - .gitignore testerCheck which paths a .gitignore file ignores and which line decided each one, using real Git matching rules.
gitignore-test - Cache-Control explainerExplain a Cache-Control header directive by directive and how browsers and CDNs will treat the response.
cache-control-explain