簡體   English   中英

使用python3(linux)設置硒時出現問題

[英]Trouble setting up selenium with python3(linux)

我是Python的初學者,最近偶然發現Selenium模塊,如果有人可以幫助我,我將不勝感激?

我似乎無法讓selenium模塊與python3一起使用。 我已經下載了用於Firefox的geckodriver,但是仍然沒有運氣,或者安裝不正確?

我正在使用此代碼:

從硒導入webdriver

瀏覽器= webdriver.Firefox()

似乎正在收到此錯誤:

“ OSError:[Errno 8]執行格式錯誤”

整個錯誤消息的副本粘貼在下面。

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    File "/home/chron/.local/lib/python3.5/site-packages/selenium/webdriver/firefox/webdriver.py", line 140, in __init__
        self.service.start()
      File "/home/chron/.local/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 74, in start
          stdout=self.log_file, stderr=self.log_file)
            File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
            restore_signals, start_new_session)
              File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
                  raise child_exception_type(errno_num, err_msg)
              OSError: [Errno 8] Exec format error

OSError:[Errno 8]執行格式錯誤

這似乎無法啟動geckodriver,因為您使用的是為錯誤架構編譯的二進制文件。 確保從https://github.com/mozilla/geckodriver/releases下載適用於您體系結構的正確版本

例如,如果您正在運行64位linux(amd64),則需要下載以“ linux64.tar.gz”結尾的geckodriver tarball。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM