From 72db8d8504cb0bef86a207e51c792ffab40714ab Mon Sep 17 00:00:00 2001 From: rocketlaunchr-cto Date: Thu, 12 Mar 2020 10:19:04 +1100 Subject: [PATCH] - update readme --- README.md | 4 ++++ search.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 92220c3..341e1d3 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,10 @@ The implementation relies on Google's search page DOM being constant. If it chan In the event it changes, this package will be updated as soon as possible. +Also note, that if you call this function too quickly, Google detects that it is being scraped and produces a [recaptcha](https://www.google.com/recaptcha/intro/v3.html) which interferes with the scraping. **Don't call it in quick succession.** + + + ## Credits Special thanks to [Edmund Martin](https://edmundmartin.com/scraping-google-with-golang/). diff --git a/search.go b/search.go index 10bb022..5cc9159 100644 --- a/search.go +++ b/search.go @@ -63,7 +63,7 @@ type SearchOptions struct { // Search returns a list of search results from Google. func Search(ctx context.Context, searchTerm string, opts ...SearchOptions) ([]Result, error) { - c := colly.NewCollector(colly.MaxDepth(0)) + c := colly.NewCollector(colly.MaxDepth(1)) if len(opts) == 0 { opts = append(opts, SearchOptions{}) }