前提・実現したいこと
seleniumを使用してfirefoxの立ち上げをしたいです。
PCを新しくすると動作しなくなりました。
(Firefoxが立ち上がるのですがすぐにエラーとなってしまいます。)
「WebDriverException: Message: newSession」と出ています。
発生している問題・エラーメッセージ
--------------------------------------------------------------------------- WebDriverException Traceback (most recent call last) <ipython-input-9-e767936b7868> in <module>() ----> 1 browser = webdriver.Firefox() 2 # browser = webdriver.Firefox(executable_path="C:\Users\atsunori.muraoka\Python") 3 4 # browser.get('https://baseconnect.in/users/sign_in') ~\Anaconda3\lib\site-packages\selenium\webdriver\firefox\webdriver.py in __init__(self, firefox_profile, firefox_binary, timeout, capabilities, proxy, executable_path, firefox_options, log_path) 152 command_executor=executor, 153 desired_capabilities=capabilities, --> 154 keep_alive=True) 155 156 # Selenium remote ~\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py in __init__(self, command_executor, desired_capabilities, browser_profile, proxy, keep_alive, file_detector) 149 warnings.warn("Please use FirefoxOptions to set browser profile", 150 DeprecationWarning) --> 151 self.start_session(desired_capabilities, browser_profile) 152 self._switch_to = SwitchTo(self) 153 self._mobile = Mobile(self) ~\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py in start_session(self, capabilities, browser_profile) 238 parameters = {"capabilities": w3c_caps, 239 "desiredCapabilities": capabilities} --> 240 response = self.execute(Command.NEW_SESSION, parameters) 241 if 'sessionId' not in response: 242 response = response['value'] ~\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py in execute(self, driver_command, params) 306 response = self.command_executor.execute(driver_command, params) 307 if response: --> 308 self.error_handler.check_response(response) 309 response['value'] = self._unwrap_value( 310 response.get('value', None)) ~\Anaconda3\lib\site-packages\selenium\webdriver\remote\errorhandler.py in check_response(self, response) 192 elif exception_class == UnexpectedAlertPresentException and 'alert' in value: 193 raise exception_class(message, screen, stacktrace, value['alert'].get('text')) --> 194 raise exception_class(message, screen, stacktrace) 195 196 def _value_or_default(self, obj, key, default): WebDriverException: Message: newSession
該当のソースコード
from selenium import webdriver browser = webdriver.Firefox()
試したこと
補足情報(FW/ツールのバージョンなど)
jupyterを使用しています。
あなたの回答
tips
プレビュー