热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Selenium异常(python)selenium.common.exceptions.WebDriverException

  Seleniumexception(python):"Thebrowserappearstohaveexited"sele


  

Selenium exception (python): "The browser appears to have exited " selenium.common.exceptions.WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor,check it for details.

log_file:
geckodriver.exe:错误:找到了参数'-e',这不是预期的,或者在这种情况下无效

用法:
    geckodriver.exe -v

有关更多信息,请尝试--help

1575724631137 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-headless" "-foreground" "-no-remote" "-profile" "C:\\Users\\User\\AppData\\Local\\Temp\\rust_mozprofileHvzCho"
*** You are running in headless mode.
1575724632057 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: mozillaAddons
1575724632057 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: telemetry
1575724632057 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: resource://pdf.js/
1575724632057 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: about:reader*
Javascript error: resource://gre/modules/XULStore.jsm,line 66: Error: Can't find profile directory.
1575724635166 Marionette INFO Listening on port 59172
1575724635463 Marionette WARN TLS certificate errors will be ignored for this session
1575724638114 Marionette INFO Stopped listening on port 59172
[Parent 3908,Gecko_IOThread] WARNING: pipe error: 109: file z:/task_1575282935/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc,line 341
[Child 8540,Chrome_ChildThread] WARNING: pipe error: 109: file z:/task_1575282935/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc,Chrome_ChildThread] WARNING: pipe error: 109: file z:/task_1575282935/build/src/ipc/chromium/src/chrome[Child 9560,line 341
[Child 9560,Chrome_ChildThread] WARNING: pipe error: 109[Child 8672,line 341
[Child 8672,line 341

我的代码:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
cap = DesiredCapabilities().FIREFOX
cap["marionette"] = False
browser = webdriver.Firefox(capabilities=cap,executable_path=r"C:\Program Files\Mozilla Firefox\firefox.exe")
browser.get('http://google.com/')





推荐阅读
author-avatar
毛毛-刘庆
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有