diff options
| author | Philipp Tanlak <philipp.tanlak@gmail.com> | 2023-08-17 20:31:44 +0200 |
|---|---|---|
| committer | Philipp Tanlak <philipp.tanlak@gmail.com> | 2023-08-17 20:31:44 +0200 |
| commit | 1a9af21755a78bb8689bd1f3830239f81dadc324 (patch) | |
| tree | 9ea058f18efbb7ab799eafa8b2c772f2fb37571c /scrape_test.go | |
| parent | 8f55226a53682f9f4a0b63778b3338451605a6c3 (diff) | |
refactor
Diffstat (limited to 'scrape_test.go')
| -rw-r--r-- | scrape_test.go | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/scrape_test.go b/scrape_test.go index 643b10d..ffd8b70 100644 --- a/scrape_test.go +++ b/scrape_test.go @@ -11,7 +11,6 @@ import ( func TestScrape(t *testing.T) { svc := flyscrape.Scraper{ - Concurrency: 10, ScrapeOptions: flyscrape.ScrapeOptions{ URL: "http://example.com/foo/bar", Depth: 1, @@ -45,24 +44,3 @@ func TestScrape(t *testing.T) { require.Equal(t, "http://example.com/foo/baz", urls[2]) require.Equal(t, "http://www.google.com/", urls[3]) } - -func TestFindLinks(t *testing.T) { - origin := "http://example.com/foo/bar" - html := ` - <html> - <body> - <a href="/baz">Baz</a> - <a href="baz">Baz</a> - <a href="http://www.google.com">Google</a> - <a href="javascript:void(0)">Google</a> - <a href="/foo#hello">Anchor</a> - </body> - </html>` - - links := flyscrape.Links(html, origin) - require.Len(t, links, 4) - require.Equal(t, "http://example.com/baz", links[0]) - require.Equal(t, "http://example.com/foo/baz", links[1]) - require.Equal(t, "http://www.google.com/", links[2]) - require.Equal(t, "http://example.com/foo", links[3]) -} |