Liyan06
commited on
Commit
·
8aee497
1
Parent(s):
c191acc
update wen_retrieval
Browse files- web_retrieval.py +2 -2
web_retrieval.py
CHANGED
|
@@ -82,7 +82,7 @@ def scrape_url(url: str, timeout=10) -> Tuple[str, str]:
|
|
| 82 |
return web_text, url
|
| 83 |
|
| 84 |
|
| 85 |
-
def search_google(query:str, num_web_pages:int=
|
| 86 |
"""Searches the query using Google.
|
| 87 |
Args:
|
| 88 |
query: Search query.
|
|
@@ -104,7 +104,7 @@ def search_google(query:str, num_web_pages:int=10, timeout:int=6, save_url:str='
|
|
| 104 |
|
| 105 |
# scrape google results
|
| 106 |
all_urls = []
|
| 107 |
-
for search_query in
|
| 108 |
for page in range(0, num_web_pages, 10):
|
| 109 |
# here page is google search's bottom page meaning, click 2 -> start=10
|
| 110 |
# url = "https://www.google.com/search?q={}&start={}".format(query, page)
|
|
|
|
| 82 |
return web_text, url
|
| 83 |
|
| 84 |
|
| 85 |
+
def search_google(query:str, num_web_pages:int=20, timeout:int=6, save_url:str='') -> List[str]:
|
| 86 |
"""Searches the query using Google.
|
| 87 |
Args:
|
| 88 |
query: Search query.
|
|
|
|
| 104 |
|
| 105 |
# scrape google results
|
| 106 |
all_urls = []
|
| 107 |
+
for search_query in [query]:
|
| 108 |
for page in range(0, num_web_pages, 10):
|
| 109 |
# here page is google search's bottom page meaning, click 2 -> start=10
|
| 110 |
# url = "https://www.google.com/search?q={}&start={}".format(query, page)
|