質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

Q&A

解決済

1回答

2495閲覧

pythonでChromeのブラウザ操作を自動化

yasaidemo

総合スコア46

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

0グッド

0クリップ

投稿2019/05/11 02:22

windows10】python3でChromeのブラウザ操作を自動化するため
Selenium WebDriverを利用しました。

コード
from selenium import webdriver
webdriver.Chrome("C:\chromedriver.exe")

するとchromeは一瞬立ち上がり
すぐに閉じてしまい
以下のエラーが出てしまいます

cheomedriverのversionは75.0.3770.8です。


SessionNotCreatedException Traceback (most recent call last)
<ipython-input-6-87c344c1ceb6> in <module>
----> 1 driver = webdriver.Chrome("C:\chromedriver.exe")

C:\Anaconda\lib\site-packages\selenium\webdriver\chrome\webdriver.py in init(self, executable_path, port, options, service_args, desired_capabilities, service_log_path, chrome_options, keep_alive)
79 remote_server_addr=self.service.service_url,
80 keep_alive=keep_alive),
---> 81 desired_capabilities=desired_capabilities)
82 except Exception:
83 self.quit()

C:\Anaconda\lib\site-packages\selenium\webdriver\remote\webdriver.py in init(self, command_executor, desired_capabilities, browser_profile, proxy, keep_alive, file_detector, options)
155 warnings.warn("Please use FirefoxOptions to set browser profile",
156 DeprecationWarning, stacklevel=2)
--> 157 self.start_session(capabilities, browser_profile)
158 self._switch_to = SwitchTo(self)
159 self._mobile = Mobile(self)

C:\Anaconda\lib\site-packages\selenium\webdriver\remote\webdriver.py in start_session(self, capabilities, browser_profile)
250 parameters = {"capabilities": w3c_caps,
251 "desiredCapabilities": capabilities}
--> 252 response = self.execute(Command.NEW_SESSION, parameters)
253 if 'sessionId' not in response:
254 response = response['value']

C:\Anaconda\lib\site-packages\selenium\webdriver\remote\webdriver.py in execute(self, driver_command, params)
319 response = self.command_executor.execute(driver_command, params)
320 if response:
--> 321 self.error_handler.check_response(response)
322 response['value'] = self._unwrap_value(
323 response.get('value', None))

C:\Anaconda\lib\site-packages\selenium\webdriver\remote\errorhandler.py in check_response(self, response)
240 alert_text = value['alert'].get('text')
241 raise exception_class(message, screen, stacktrace, alert_text)
--> 242 raise exception_class(message, screen, stacktrace)
243
244 def _value_or_default(self, obj, key, default):

SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 75

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

can110

2019/05/11 02:26

Chromeブラウザのバージョンを記載ください。
yasaidemo

2019/05/11 03:22

Google Chrome は最新版です バージョン: 74.0.3729.131(Official Build) (64 ビット) よろしくおねがいします。
guest

回答1

0

ベストアンサー

ChromeDriverのバージョンが新しすぎます。
ChromeDriver - WebDriver for ChromeからChromeDriver 74.0.3729.6をダウンロードください。

投稿2019/05/11 05:47

can110

総合スコア38234

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

yasaidemo

2019/05/11 11:55

お返事が遅れまして申し訳がありません。 出来ました!! ありがとうございました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問