- update readme

This commit is contained in:
rocketlaunchr-cto 2020-03-12 10:19:04 +11:00
parent da80521ed1
commit 72db8d8504
2 changed files with 5 additions and 1 deletions

View File

@ -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/).

View File

@ -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{})
}