我有一個Selenium腳本,它正確地在PC和服務器上工作。幾天前它停止了服務器,但我還沒有弄清楚什麼是錯的。我通過PC和本地設置了Firefox(41.0.2)和Selenium(2.53.5)。Selenium在服務器上無法正常工作
運行:
from selenium import webdriver
browser = webdriver.Firefox()
隨着當前版本我面對這樣的錯誤:
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.
我要指出,我跑我的代碼以設置DISPLAY:= 1;
我決定硒升級到3.0.2,我面對的:
IOError: [Errno 13] Permission denied: 'geckodriver.log'
基於誰遇到這個問題其他人的建議,我下載geckidriver並把它在/ usr/local/bin目錄。但是,我仍然無法運行我的代碼。奇怪的部分是代碼運行沒有任何問題,通過電腦!
任何意見或建議?
這是geckodriver.log的輸出:
(firefox:94561): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
/usr/bin/dbus-launch terminated abnormally without any error message
1484733755568 geckodriver INFO Listening on 127.0.0.1:35823
1484733756567 mozprofile::profile INFO Using profile path /tmp/rust_mozprofile.UiIxs53qoUs1
1484733756568 geckodriver::marionette INFO Starting browser /usr/bin/firefox
1484733756573 geckodriver::marionette INFO Connecting to Marionette on localhost:44907
(process:95171): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Xlib中:擴展名 「RANDR」 缺失上顯示 「:1」。
(firefox:95171): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
/usr/bin/dbus-launch terminated abnormally without any error message
(firefox:95171): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
/usr/bin/dbus-launch terminated abnormally without any error message
(firefox:95171): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
/usr/bin/dbus-launch terminated abnormally without any error message
(firefox:95171): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
/usr/bin/dbus-launch terminated abnormally without any error message
感謝
這是我的geckodriver.log: – Moohebat