AttributeError: 'GoogleImageScraper' object has no attribute 'driver'
Closed this issue · 4 comments
CodeElevator commented
File "c:\Users\me\Desktop\face_recognition\google.py", line 77, in find_image_urls
self.driver.get(self.url)
AttributeError: 'GoogleImageScraper' object has no attribute 'driver'
ohyicong commented
are you able to run the code as it is? (without changing it's directory)
CodeElevator commented
Yes just changing the code, I want to make a face comparisons it won't work here's what I added:
import os
import requests
from google import GoogleImageScraper
from patch import webdriver_executable
if __name__ == "__main__":
to_image = input("Enter the link of an image: ")
r = requests.get(to_image)
file = open("./photos/image.png", "wb")
file.write(r.content)
file.close()
to_download = input("Enter a search key: ")
webdriver_path = os.path.normpath(os.path.join(os.getcwd(), 'webdriver', webdriver_executable()))
image_path = os.path.normpath(os.path.join(os.getcwd(), 'photos'))
search_keys= to_download
nb_img = input("Enter the number of images you want to download: ")
#Parameters
number_of_images = nb_img
headless = False
min_resolution=(0,0)
max_resolution=(9999,9999)
I didn't change anything else
ohyicong commented
did you copy the webdriver into your project folder?
ohyicong commented
anyway this is not an issue