前提・実現したいこと
PythonでSeleniumを使ってスムーズにChromeを操作したい。
発生している問題・エラーメッセージ
実行してChromeが立ち上がるまでは早いのですが、そこから指定の任意のURLの画面に
移動できず、エラーで終了する。(アドレスバーに「data;,」で指定のURLが入らず動かない)
※2.38以前のドライバを使えば20秒ほどフリーズして遷移する
2.41のドライバを使った際のエラー Traceback (most recent call last): File "C:/Users/4039542/PycharmProjects/rpa/google.py", line 3, in <module> browser = webdriver.Chrome(executable_path = r'./chromedriver.exe') File "C:\Users\4039542\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 75, in __init__ desired_capabilities=desired_capabilities) File "C:\Users\4039542\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 156, in __init__ self.start_session(capabilities, browser_profile) File "C:\Users\4039542\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 251, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "C:\Users\4039542\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 320, in execute self.error_handler.check_response(response) File "C:\Users\4039542\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.SessionNotCreatedException: Message: session not created exception from disconnected: unable to connect to renderer (Session info: chrome=68.0.3440.106) (Driver info: chromedriver=2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 10.0.16299 x86_64)
該当のソースコード
Python
1from selenium import webdriver 2 3browser = webdriver.Chrome(executable_path = r'./chromedriver.exe') 4browser.get("http://google.com")
試したこと
各種Chromedriverを試しました。
2.30-2.38:起動後遷移に20秒ほどかかる
2.39,2.40,2.41 上記のエラーになって終了
補足情報(FW/ツールのバージョンなど)
環境は下記の通りです。
OS:Win10
Python:3.6
Selenium:3.12.0
Chrome:68.0.3440.106(最新)
ChromeDriver:2.41

回答5件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/08/09 04:42