MAsad789565 commited on
Commit
caebafc
1 Parent(s): e35d7eb

Update networks/google_searcher.py

Browse files
Files changed (1) hide show
  1. networks/google_searcher.py +2 -5
networks/google_searcher.py CHANGED
@@ -14,7 +14,7 @@ class GoogleSearcher:
14
  self.enver.set_envs(proxies=True)
15
  self.filepath_converter = QueryToFilepathConverter()
16
 
17
- def send_request(self, result_num=10, safe=False):
18
  self.request_response = requests.get(
19
  url=self.url,
20
  headers=REQUESTS_HEADERS,
@@ -32,7 +32,7 @@ class GoogleSearcher:
32
  with open(self.html_path, "wb") as wf:
33
  wf.write(self.request_response.content)
34
 
35
- def search(self, query, result_num=10, safe=False, overwrite=False):
36
  self.query = query
37
  self.html_path = self.filepath_converter.convert(self.query)
38
  logger.note(f"Searching: [{self.query}]")
@@ -45,6 +45,3 @@ class GoogleSearcher:
45
 
46
 
47
  if __name__ == "__main__":
48
- searcher = GoogleSearcher()
49
- # searcher.search("python教程")
50
- searcher.search("python tutorials")
 
14
  self.enver.set_envs(proxies=True)
15
  self.filepath_converter = QueryToFilepathConverter()
16
 
17
+ def send_request(self, result_num, safe=False):
18
  self.request_response = requests.get(
19
  url=self.url,
20
  headers=REQUESTS_HEADERS,
 
32
  with open(self.html_path, "wb") as wf:
33
  wf.write(self.request_response.content)
34
 
35
+ def search(self, query, result_num, safe=False, overwrite=False):
36
  self.query = query
37
  self.html_path = self.filepath_converter.convert(self.query)
38
  logger.note(f"Searching: [{self.query}]")
 
45
 
46
 
47
  if __name__ == "__main__":