diff options
| author | Philipp Tanlak <philipp.tanlak@gmail.com> | 2025-01-10 13:09:50 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-10 13:09:50 +0100 |
| commit | 40e02d5d28e59dbeb6134afdce12536c602e6aa5 (patch) | |
| tree | 24c84c4084cf72e552804397eecc9f5bb3c2d4be /README.md | |
| parent | bf99c233a18c3165e0d4d251b41224e5bc6eb93d (diff) | |
Implement manual following (#82)
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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. } ``` |