Я пытаюсь запустить загрузку данных из браузера chrome с помощью chromedriver в файле python - PullRequest
0 голосов
/ 23 февраля 2020

Я получаю эту ошибку при использовании драйвера chrome для загрузки изображений Google ... драйвер chrome также находится в пути. Исполняемый файл загружен, но проблема не устранена.

Windows 10 операционная система .. Хромедрайвер также устанавливается через пипс ...

Вход:

if __name__ == '__main__':
    chrome_driver = 'C:\\Users\\320086442\\AppData\\Local\\Continuum\\anaconda3\\Lib\\site-packages\\selenium\\webdriver\\chrome'

# download the emotion data
    data_dir = 'C:\\Users\\320086442\\Downloads\\emotion-master\\image_net'
    emotions = {'angry': ['angry', 'furious', 'resentful', 'irate'],
            'disgusted': ['disgusted', 'sour', 'grossed out'],
            'happy': ['happy', 'smiling', 'cheerful', 'elated', 'joyful'],
            'sad': ['sad', 'depressed', 'sorrowful', 'mournful', 'grieving', 'crying'],
            'surprised': ['surprised', 'astonished', 'shocked', 'amazed']}
    download_emotions(emotions, data_dir, chrome_driver)

# download the pseudo Imagenet data
    imagenet_labels = []
    with open('C:\\Users\\320086442\\Downloads\\emotion-master\\image_net\\imagenet_labels.txt', 'r') as file:
        for line in file:
            imagenet_labels.append(line.strip())
    data_dir = 'C:\\Users\\320086442\\Downloads\\emotion-master'
    imagenet_label_file = 'C:\\Users\\320086442\\Downloads\\emotion-master\\image_net\\imagenet_labels.txt'
    download_fake_imagenet(imagenet_labels, data_dir, chrome_driver)

Выход:

 C:\Users\320086442\AppData\Local\Continuum\anaconda3\python.exe C:/Users/320086442/Downloads/emotion- 
master/download_data.py
Downloading images for: angry human face ...
Looks like we cannot locate the path the 'chromedriver' (use the '--chromedriver' argument to specify 
the path to the executable.) or google chrome browser is not installed on your machine (exception: 
use 
options instead of chrome_options)

Process finished with exit code 0
...