[Python] Python-No such file or directory getAttribute.js

Discussão em 'Python' iniciado por Stack, Dezembro 21, 2024.

  1. Stack

    Stack Membro Participativo

    I had a Python selenium program working a week or so ago. Now selenium fails on the import:

    from selenium import webdriver


    The IDLE ouput:

    Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 17:26:49) [MSC v.1900 32 bit (Intel)] on win32
    Type "copyright", "credits" or "license()" for more information.
    >>>
    RESTART: C:\Users\Mike\AppData\Local\Programs\Python\Python36-32\testpack.py
    Traceback (most recent call last):
    File "C:\Users\Mike\AppData\Local\Programs\Python\Python36-32\testpack.py", line 1, in <module>
    from selenium import webdriver
    File "C:\Users\Mike\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\__init__.py", line 18, in <module>
    from .firefox.webdriver import WebDriver as Firefox # noqa
    File "C:\Users\Mike\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 35, in <module>
    from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
    File "C:\Users\Mike\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 26, in <module>
    from .webelement import WebElement
    File "C:\Users\Mike\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 43, in <module>
    getAttribute_js = pkgutil.get_data(_pkg, 'getAttribute.js').decode('utf8')
    File "C:\Users\Mike\AppData\Local\Programs\Python\Python36-32\lib\pkgutil.py", line 634, in get_data
    return loader.get_data(resource_name)
    File "<frozen importlib._bootstrap_external>", line 832, in get_data
    FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Mike\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\site-packages\\selenium\\webdriver\\remote\\getAttribute.js'
    >>>


    When I try to reinstall the package with pip, I am told that the requirements are satisfied.

    chromedriver.exe is in c:\Windows\system32.

    Any ideas greatly appreciated.

    Continue reading...

Compartilhe esta Página