From 40e02d5d28e59dbeb6134afdce12536c602e6aa5 Mon Sep 17 00:00:00 2001 From: Philipp Tanlak Date: Fri, 10 Jan 2025 13:09:50 +0100 Subject: Implement manual following (#82) --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 6a3290c..aef331b 100644 --- a/README.md +++ b/README.md @@ -204,7 +204,9 @@ export const config = { // Specify how deep links should be followed. (default = 0, no follow) depth: 5, - // Speficy the css selectors to follow. (default = ["a[href]"]) + // Specify the css selectors to follow. (default = ["a[href]"]) + // Setting follow to [] disables automatic following. + // Can later be used with manual following. follow: [".next > a", ".related a"], // Specify the allowed domains. ['*'] for all. (default = domain from url) @@ -260,7 +262,7 @@ export const config = { }, }; -export default function ({ doc, url, absoluteURL, scrape }) { +export default function ({ doc, url, absoluteURL, scrape, follow }) { // doc // Contains the parsed HTML document. @@ -274,6 +276,10 @@ export default function ({ doc, url, absoluteURL, scrape }) { // return { ... }; // }) // Scrapes a linked page and returns the scrape result. + + // follow("/foo") + // Follows a link manually. + // Disable automatic following with `follow: []` for best results. } ``` -- cgit v1.2.3