- update readme
This commit is contained in:
parent
da80521ed1
commit
72db8d8504
@ -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.
|
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
|
## Credits
|
||||||
|
|
||||||
Special thanks to [Edmund Martin](https://edmundmartin.com/scraping-google-with-golang/).
|
Special thanks to [Edmund Martin](https://edmundmartin.com/scraping-google-with-golang/).
|
||||||
|
@ -63,7 +63,7 @@ type SearchOptions struct {
|
|||||||
// Search returns a list of search results from Google.
|
// Search returns a list of search results from Google.
|
||||||
func Search(ctx context.Context, searchTerm string, opts ...SearchOptions) ([]Result, error) {
|
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 {
|
if len(opts) == 0 {
|
||||||
opts = append(opts, SearchOptions{})
|
opts = append(opts, SearchOptions{})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user