diff --git a/google_images_download/google_images_download.py b/google_images_download/google_images_download.py index fd89a3a9..0d1fa3fa 100755 --- a/google_images_download/google_images_download.py +++ b/google_images_download/google_images_download.py @@ -34,6 +34,8 @@ import codecs import socket +from selenium.webdriver.common.by import By + args_list = ["keywords", "keywords_from_file", "prefix_keywords", "suffix_keywords", "limit", "format", "color", "color_type", "usage_rights", "size", "exact_size", "aspect_ratio", "type", "time", "time_range", "delay", "url", "single_image", @@ -187,14 +189,14 @@ def download_extended_page(self,url,chromedriver): time.sleep(1) print("Getting you a lot of images. This may take a few moments...") - element = browser.find_element_by_tag_name("body") + element = browser.find_element(By.TAG_NAME, "body") # Scroll down for i in range(30): element.send_keys(Keys.PAGE_DOWN) time.sleep(0.3) try: - browser.find_element_by_id("smb").click() + browser.find_element(By.ID, "smb").click() for i in range(50): element.send_keys(Keys.PAGE_DOWN) time.sleep(0.3) # bot id protection