Missing file in compiled py2exe app selenium

♀尐吖头ヾ 提交于 2019-12-02 00:50:34
pppk520

Check the original answer: Python - Trouble in building executable

You have to manually copy both webdriver.xpi and webdriver_prefs.json from C:\Python27\Lib\site-packages\selenium\webdriver\firefox to dist\selenium\webdriver\firefox

This worked: Edit firefox_profile.py: WEBDRIVER_EXT, WEBDRIVER_PREFERENCES:

if getattr(sys, 'frozen', False): WEBDRIVER_EXT = os.path.join(os.path.dirname(sys.executable), "webdriver.xpi") WEBDRIVER_PREFERENCES = os.path.join(os.path.dirname(sys.executable), "webdriver_prefs.json") elif file: WEBDRIVER_EXT = os.path.join(os.path.dirname(file), "webdriver.xpi") WEBDRIVER_PREFERENCES = os.path.join(os.path.dirname(file), "webdriver_prefs.json")

goto the line "with open(...." and replace with "with open(WEBDRIVER_PREFERENCES) as default_prefs"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!