Python-没有这样的文件或目录getAttribute.js [英] Python-No such file or directory getAttribute.js

查看:532
本文介绍了Python-没有这样的文件或目录getAttribute.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大约一周前,我有一个Python硒程序运行.现在硒导入失败:

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

from selenium import webdriver

IDLE输出:

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'
>>> 

当我尝试使用pip重新安装该软件包时,会被告知满足要求.

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

chromedriver.exe位于c:\ Windows \ system32中.

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

任何想法都很感激.

推荐答案

您的webdriver安装文件已损坏或丢失.重新安装/升级webdriver egg.

Your webdriver installation files are either corrupted or missing. Reinstall/upgrade the webdriver eggs.

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'

尝试一下:

pip install selenium --upgrade

这篇关于Python-没有这样的文件或目录getAttribute.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆