From c36bb2ca2a82338a822c6962f3373809b4bed814 Mon Sep 17 00:00:00 2001 From: Philipp Tanlak Date: Wed, 16 Aug 2023 19:58:10 +0200 Subject: add allowed domains feature --- scrape_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scrape_test.go') diff --git a/scrape_test.go b/scrape_test.go index 5d6e578..643b10d 100644 --- a/scrape_test.go +++ b/scrape_test.go @@ -13,8 +13,9 @@ func TestScrape(t *testing.T) { svc := flyscrape.Scraper{ Concurrency: 10, ScrapeOptions: flyscrape.ScrapeOptions{ - URL: "http://example.com/foo/bar", - Depth: 1, + URL: "http://example.com/foo/bar", + Depth: 1, + AllowedDomains: []string{"example.com", "www.google.com"}, }, ScrapeFunc: func(params flyscrape.ScrapeParams) (any, error) { return map[string]any{ -- cgit v1.2.3