Skip to content

Commit

Permalink
Update code to click term & conditions automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
ohyicong committed Apr 27, 2023
1 parent 321219b commit 3d3bcb0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions GoogleImageScraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ def __init__(self, webdriver_path, image_path, search_key="cat", number_of_image
driver = webdriver.Chrome(webdriver_path, chrome_options=options)
driver.set_window_size(1400,1050)
driver.get("https://www.google.com")
try:
WebDriverWait(driver, 5).until(EC.element_to_be_clickable((By.ID, "W0wltc"))).click()
except Exception as e:
continue
except Exception as e:
#update chromedriver
pattern = '(\d+\.\d+\.\d+\.\d+)'
Expand Down

0 comments on commit 3d3bcb0

Please sign in to comment.