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 /js.go | |
| parent | bf99c233a18c3165e0d4d251b41224e5bc6eb93d (diff) | |
Implement manual following (#82)
Diffstat (limited to 'js.go')
| -rw-r--r-- | js.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -30,6 +30,7 @@ type ScrapeParams struct { HTML string URL string Process func(url string) ([]byte, error) + Follow func(url string) } type ScrapeFunc func(ScrapeParams) (any, error) @@ -213,6 +214,9 @@ func scrape(vm *goja.Runtime) (ScrapeFunc, error) { return f(goja.FunctionCall{Arguments: []goja.Value{arg}}) }) + o.Set("follow", func(url string) { + p.Follow(absoluteURL(url)) + }) return o, nil } |