from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from webdriver_manager.firefox import GeckoDriverManager

keyword = ''
createFolder('./' + keyword + '_img_download')

options = Options()
options.binary_location = "C:/Program Files/Mozilla Firefox/firefox.exe"  # 파이어폭스 실행 파일 경로
driver = webdriver.Firefox(executable_path="C:/Program Files/Mozilla Firefox/geckodriver.exe", options=options)
driver.implicitly_wait(3)


DEBUG:selenium.webdriver.common.selenium_manager:Output: "" DEBUG:selenium.webdriver.common.selenium_manager:geckodriver 0.33.0 already in the cache DEBUG:selenium.webdriver.common.selenium_manager:Using driver at: /root/.cache/selenium/geckodriver/linux64/0.33.0/geckodriver DEBUG:selenium.webdriver.common.service:Started executable: `/root/.cache/selenium/geckodriver/linux64/0.33.0/geckodriver` in a child process with pid: 32164 DEBUG:selenium.webdriver.remote.remote_connection:POST http://localhost:39131/session {"capabilities": {"firstMatch": [{}], "alwaysMatch": {"browserName": "firefox", "acceptInsecureCerts": true, "moz:debuggerAddress": true, "pageLoadStrategy": "normal", "moz:firefoxOptions": {"binary": "C:/Program Files/Mozilla Firefox/firefox.exe"}}}} DEBUG:selenium.webdriver.remote.remote_connection:Remote response: status=400 | data={"value":{"error":"invalid argument","message":"binary is not a Firefox executable","stacktrace":""}} | headers=HTTPHeaderDict({'content-type': 'application/json; charset=utf-8', 'cache-control': 'no-cache', 'content-length': '101', 'date': 'Sat, 27 May 2023 04:34:34 GMT'}) DEBUG:selenium.webdriver.remote.remote_connection:Finished Request
--------------------------------------------------------------------------- InvalidArgumentException Traceback (most recent call last) <ipython-input-72-fd14ab3a3126> in <cell line: 10>() 8 options = Options() 9 options.binary_location = "C:/Program Files/Mozilla Firefox/firefox.exe" # 파이어폭스 실행 파일 경로 ---> 10 driver = webdriver.Firefox(executable_path="C:/Program Files/Mozilla Firefox/geckodriver.exe", options=options) 11 driver.implicitly_wait(3)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/firefox/webdriver.py in __init__(self, firefox_profile, firefox_binary, capabilities, proxy, executable_path, options, service_log_path, service_args, service, desired_capabilities, log_path, keep_alive) 199 remote_server_addr=self.service.service_url, ignore_proxy=options._ignore_local_proxy 200 ) --> 201 super().__init__(command_executor=executor, options=options, keep_alive=True) 202 203 self._is_remote = False /usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py in __init__(self, command_executor, desired_capabilities, browser_profile, proxy, keep_alive, file_detector, options) 284 self._authenticator_id = None 285 self.start_client() --> 286 self.start_session(capabilities, browser_profile) 287 288 def __repr__(self): /usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py in start_session(self, capabilities, browser_profile) 376 w3c_caps = _make_w3c_caps(capabilities) 377 parameters = {"capabilities": w3c_caps} --> 378 response = self.execute(Command.NEW_SESSION, parameters) 379 if "sessionId" not in response: 380 response = response["value"] /usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py in execute(self, driver_command, params) 438 response = self.command_executor.execute(driver_command, params) 439 if response: --> 440 self.error_handler.check_response(response) 441 response["value"] = self._unwrap_value(response.get("value", None)) 442 return response /usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py in check_response(self, response) 243 alert_text = value["alert"].get("text") 244 raise exception_class(message, screen, stacktrace, alert_text) # type: ignore[call-arg] # mypy is not smart enough here --> 245 raise exception_class(message, screen, stacktrace)


InvalidArgumentException: Message: binary is not a Firefox executable

좆지랄을 해도 해결이 안되노 이거 ㅠ씨발