summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorPhilipp Tanlak <philipp.tanlak@gmail.com>2025-01-10 13:09:50 +0100
committerGitHub <noreply@github.com>2025-01-10 13:09:50 +0100
commit40e02d5d28e59dbeb6134afdce12536c602e6aa5 (patch)
tree24c84c4084cf72e552804397eecc9f5bb3c2d4be /README.md
parentbf99c233a18c3165e0d4d251b41224e5bc6eb93d (diff)
Implement manual following (#82)
Diffstat (limited to 'README.md')
-rw-r--r--README.md10
1 files changed, 8 insertions, 2 deletions
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.
}
```