find-patterns
Extract and filter anchor links from a web page by matching their absolute URLs against a specified regex pattern. Returns both the URL and anchor text for each matching link.
Instructions
Fetches a web page, extracts all anchor ('a') links, resolves their absolute URLs, and returns a list of links whose URLs match a given JavaScript-compatible regular expression pattern. Includes the URL and anchor text for each match.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
pattern | Yes | A JavaScript-compatible regular expression pattern (without enclosing slashes or flags) used to test against the absolute URLs of the links found on the page. Example: 'product\/\d+' to find product links. | |
url | Yes | The fully qualified URL of the web page to search for link patterns. Must be a valid HTTP or HTTPS URL. |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"pattern": {
"description": "A JavaScript-compatible regular expression pattern (without enclosing slashes or flags) used to test against the absolute URLs of the links found on the page. Example: 'product\\/\\d+' to find product links.",
"minLength": 1,
"type": "string"
},
"url": {
"description": "The fully qualified URL of the web page to search for link patterns. Must be a valid HTTP or HTTPS URL.",
"format": "uri",
"type": "string"
}
},
"required": [
"url",
"pattern"
],
"type": "object"
}