【質問】Win10:python3.6+selenium+Chromeで起動後、画面遷移が遅い

3,420 views
Skip to first unread message

Takuya Yoshida

unread,
Jun 10, 2018, 10:31:31 PM6/10/18
to 日本Seleniumユーザーコミュニティ
実行してChromeが立ち上がるまでは早いのですが、そこから指定の任意のURLの画面に
移動するまで20秒ほどフリーズします。(添付PNGのようにアドレスバーに「data;,」で指定のURLが入らず動かない) 
設定の問題でしょうか?

環境は下記の通りです。
OS:Win10
Python:3.6
Selenium:3.12.0
Chrome:67.0.3396.79(最新)
ChromeDriver:2.38 ※それより新しい2.39,2.40では、立ち上がってから遷移すらしない

実行ソース
from selenium import webdriver
browser = webdriver.Chrome("./chromedriver/2.38/chromedriver.exe")
browser.get("https://www.google.co.jp/");
print(browser.page_source)

よろしくお願い致します。
キャプチャ.PNG

Jun-ichi Sakamoto

unread,
Jun 11, 2018, 7:08:34 PM6/11/18
to 日本Seleniumユーザーコミュニティ
当方、Python ではなく C# なのですが、投稿頂いたような現象は起きていないです。
よって、OS や Chrome、及び ChromeDriver には問題ない可能性が高い(= Selenium Python バインディングの問題?)かもしれませんね。

直接の解にはなりませんが、何かしらご参考になれば幸いです。

OS: Windows10 1803 Pro 64bit
Selenium:3.12.0
Chrome:67.0.3396.79(最新) 64bit
ChromeDriver:2.40

あと、ChromeDriver のコンソール出力に、何か問題報告的なメッセージが出力されてたりしますでしょうかね。
ちょっとその点が気になりました。

※ OS と Chrome とが、それぞれ、32bit 版なのか 64bit 版なのかとか関係... ないですよねぇ。

Takuya Yoshida

unread,
Jun 14, 2018, 3:00:36 AM6/14/18
to 日本Seleniumユーザーコミュニティ
ご返信ありがとうございました。

C#では問題ないということは、Pythonとseleniumの問題のようですね、、、
32bit,64bitは両方のChromeを落として、Pythonも32bit、64bitの両方で試してみましたが、
あまり大差ないようでした。

2.38以前のドライバだと20秒ほど固まるもののそのあとは処理が動きますので、
エラーは吐きません。
ただ、2.39や2.40のドライバを使った際には下記のようなエラーが出ました。

<エラー>
C:\Users\4039542\AppData\Local\Continuum\anaconda3\python.exe C:/Users/4039542/PycharmProjects/workspace/Chrome.py
Traceback (most recent call last):
  File "C:/Users/4039542/PycharmProjects/workspace/Chrome.py", line 2, in <module>
    browser = webdriver.Chrome("./chromedriver/2.40/chromedriver.exe")
  File "C:\Users\4039542\AppData\Local\Continuum\anaconda3\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 75, in __init__
    desired_capabilities=desired_capabilities)
  File "C:\Users\4039542\AppData\Local\Continuum\anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 156, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\4039542\AppData\Local\Continuum\anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 245, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Users\4039542\AppData\Local\Continuum\anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 314, in execute
    self.error_handler.check_response(response)
  File "C:\Users\4039542\AppData\Local\Continuum\anaconda3\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=67.0.3396.87)
  (Driver info: chromedriver=2.40.565498 (ea082db3280dd6843ebfb08a625e3eb905c4f5ab),platform=Windows NT 10.0.16299 x86_64)


Process finished with exit code 1





2018年6月12日火曜日 8時08分34秒 UTC+9 Jun-ichi Sakamoto:
Reply all
Reply to author
Forward
0 new messages