Actualiser google_scraping.py
This commit is contained in:
parent
5740be9bbc
commit
70d581758b
|
@ -19,7 +19,7 @@ def google_scrap_fooding(df):
|
||||||
|
|
||||||
url = base_url + str(name).replace(' ', '-') + str(address).replace(' ', '-')
|
url = base_url + str(name).replace(' ', '-') + str(address).replace(' ', '-')
|
||||||
ic()
|
ic()
|
||||||
ic(url)
|
ic(name)
|
||||||
|
|
||||||
driver.get(url)
|
driver.get(url)
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
@ -69,14 +69,13 @@ def google_scrap_fute(df):
|
||||||
ic()
|
ic()
|
||||||
for name, address in zip(df['Name'], df['Address']):
|
for name, address in zip(df['Name'], df['Address']):
|
||||||
ic()
|
ic()
|
||||||
|
ic(name)
|
||||||
options = webdriver.ChromeOptions()
|
options = webdriver.ChromeOptions()
|
||||||
options.add_argument("---headless=True")
|
options.add_argument("---headless=True")
|
||||||
driver = webdriver.Chrome(options=options)
|
driver = webdriver.Chrome(options=options)
|
||||||
base_url = 'https://www.google.com/search?hl=en&q='
|
base_url = 'https://www.google.com/search?hl=en&q='
|
||||||
try:
|
try:
|
||||||
url = base_url + name.replace(' ', '-') + address.replace(' ', '-')
|
url = base_url + name.replace(' ', '-') + address.replace(' ', '-')
|
||||||
ic(url)
|
|
||||||
|
|
||||||
driver.get(url)
|
driver.get(url)
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user