Skip to content

Commit caa9098

Browse files
set timeout at GoogleSearch instantiation
1 parent 3792912 commit caa9098

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

serpapi/google_search.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@ class GoogleSearch(SerpApiClient):
44
"""GoogleSearch enables to search google and parse the result.
55
```python
66
from serpapi import GoogleSearch
7-
query = GoogleSearch({"q": "coffee", "location": "Austin,Texas"})
7+
query = GoogleSearch(
8+
{
9+
"q": "coffee",
10+
"location": "Austin,Texas",
11+
},
12+
timeout = 60,
13+
)
814
data = query.get_json()
915
```
1016
1117
https://github.com/serpapi/google-search-results-python
1218
"""
1319

14-
def __init__(self, params_dict):
15-
super(GoogleSearch, self).__init__(params_dict, GOOGLE_ENGINE)
20+
def __init__(self, params_dict, timeout = 60):
21+
super(GoogleSearch, self).__init__(params_dict, GOOGLE_ENGINE, timeout)

0 commit comments

Comments
 (0)