Отказано в доступе при загрузке Firefox в GeckoDriver - PullRequest
0 голосов
/ 03 апреля 2019

Я получил «PermissionError: [Errno 13] Отказано в разрешении:« firefox »» при запуске файла скреппера в python3

from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary

options = Options()
options.add_argument('--headless')
options.add_argument('--disable-gpu')

binary = FirefoxBinary('firefox')
cap = DesiredCapabilities().FIREFOX
cap["marionette"] = False
driver = webdriver.Firefox(executable_path='geckodriver', options=options, capabilities=cap, firefox_binary=binary)

Но потом я получил:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/firefox/webdriver.py", line 175, in __init__
    self.binary, timeout)
  File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/firefox/extension_connection.py", line 52, in __init__
    self.binary.launch_browser(self.profile, timeout=timeout)
  File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 72, in launch_browser
    self._start_from_profile_path(self.profile.path)
  File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 95, in _start_from_profile_path
    env=self._firefox_env)
  File "/usr/local/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/local/lib/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: 'firefox'

Всеэто в DockerImage

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...