@@ -10,8 +10,8 @@ class SerpApiClient(object):
10
10
```python
11
11
from serpapi import GoogleSearch
12
12
search = SerpApiClient({
13
- "q": "Coffee",
14
- "location": "Austin,Texas",
13
+ "q": "Coffee",
14
+ "location": "Austin,Texas",
15
15
"engine": "google",
16
16
"api_key": "<your private key>"
17
17
})
@@ -61,15 +61,11 @@ def get_results(self, path='/search'):
61
61
"""
62
62
return self .get_response (path ).text
63
63
64
- def get_html (self , path = '/search' ):
64
+ def get_html (self , path = '/search.html ' ):
65
65
"""Returns:
66
66
Raw HTML search result from Google
67
67
"""
68
- response = self .get_dictionary () # get search URL with query parameters
69
- response = response ['search_metadata' ]['raw_html_file' ]
70
- response = requests .get (response ).text
71
- # print(response)
72
- return response
68
+ return self .get_response (path ).text
73
69
74
70
def get_json (self ):
75
71
"""Returns:
@@ -99,7 +95,7 @@ def get_dict(self):
99
95
return self .get_dictionary ()
100
96
101
97
def get_object (self ):
102
- """Returns:
98
+ """Returns:
103
99
Dynamically created python object wrapping the result data structure
104
100
"""
105
101
# iterative over response hash
@@ -134,7 +130,7 @@ def make_pyobj(self, name, node):
134
130
def get_search_archive (self , search_id , format = 'json' ):
135
131
"""Retrieve search result from the Search Archive API
136
132
Parameters:
137
- search_id (int): unique identifier for the search provided by metadata.id
133
+ search_id (int): unique identifier for the search provided by metadata.id
138
134
format (string): search format: json or html [optional]
139
135
Returns:
140
136
dict|string: search result from the archive
0 commit comments