Python3 geckodriver Problem

  • Hallo ich bekomme folgende fehler meldung und komme nicht mehr weiter habe gegoogelt leider erfolglos.


    Traceback (most recent call last):

    File "botAccountCreate.py", line 12, in <module>

    browser= webdriver.Firefox(r"/usr/lib/firefox")

    File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/firefox/webdriver.py", line 164, in __init__

    self.service.start()

    File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/common/service.py", line 83, in start

    os.path.basename(self.path), self.start_error_message)

    selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.


    Code:


    Python
    from selenium import webdriver
    import time
    from selenium.webdriver.common.keys import Keys
    from selenium.webdriver.common.by import By
    from selenium.webdriver.support.ui import WebDriverWait
    from selenium.webdriver.support import expected_conditions as EC
    
    
    browser= webdriver.Firefox(r"/usr/lib/firefox")

    Du willst mich kennenlernen? Kauf mein Buch, Bia*ch!


  • Oke jetzt kommt folgendes


    Code:

    browser = webdriver.Firefox(executable_path="./drivers/geckodriver")


    (env) root@h2892355:/home/Test# python3 ex00.py

    Traceback (most recent call last):

    File "ex00.py", line 3, in <module>

    browser = webdriver.Firefox(executable_path="./drivers/geckodriver")

    File "/home/Test/env/lib/python3.6/site-packages/selenium/webdriver/firefox/webdriver.py", line 174, in __init__

    keep_alive=True)

    File "/home/Test/env/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__

    self.start_session(capabilities, browser_profile)

    File "/home/Test/env/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session

    response = self.execute(Command.NEW_SESSION, parameters)

    File "/home/Test/env/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute

    self.error_handler.check_response(response)

    File "/home/Test/env/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response

    raise exception_class(message, screen, stacktrace)

    selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status 1


    //edit Geckodriver log:

    1612023885099 geckodriver INFO Listening on 127.0.0.1:51167

    1612023885108 mozrunner::runner INFO Running command: "/usr/bin/firefox" "--marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofileopICi8"

    Error: no DISPLAY environment variable specified

    Du willst mich kennenlernen? Kauf mein Buch, Bia*ch!


  • Terminal:



    Code:

    Python
    from selenium import webdriver
    from selenium.webdriver.firefox.options import Options
    from selenium.webdriver.common.keys import Keys
    firefoxOptions = Options()
    firefoxOptions.add_argument("-headless")
    browser = webdriver.Firefox(executable_path="./drivers/geckodriver", options=firefoxOptions)
    browser.get('https://www.google.de')
    print('Seiten Name: %s' % browser.title)
    browser.quit()




    log:



    //EDIT Unerklärlicherweise gings nach einem Reboot.

    Du willst mich kennenlernen? Kauf mein Buch, Bia*ch!


    Einmal editiert, zuletzt von Maho ()