2016-11-16 12 views
0

私はFirefoxとIEでセレンの仕事を得たが、私はまだクロームで仕事を得ることができません:SのPython 3.5セレンwebdriverをクローム

これは(単にチェックする簡単な)私のコードです:

from selenium import webdriver 
driver = webdriver.Chrome() 
driver.get('https://www.google.com') 

問題は、Chromeはウィンドウを開きますが立ち往生した後、Webページに移動しないと、私はこのエラーを受信して​​いないどちらもということです:

Traceback (most recent call last): File "C:/Users/Carlo/Desktop/CEx/src/IE.py", line 21, in driver.get(' https://www.google.com ') File "C:\Python35-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 248, in get self.execute(Command.GET, {'url': url}) File "C:\Python35-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 234, in execute response = self.command_executor.execute(driver_command, params) File "C:\Python35-32\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 407, in execute return self._request(command_info[0], url, body=data) File "C:\Python35-32\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 439, in _request resp = self._conn.getresponse() File "C:\Python35-32\lib\http\client.py", line 1197, in getresponse response.begin() File "C:\Python35-32\lib\http\client.py", line 297, in begin version, status, reason = self._read_status() File "C:\Python35-32\lib\http\client.py", line 258, in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") File "C:\Python35-32\lib\socket.py", line 575, in readinto return self._sock.recv_into(b) ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host

問題は、私は他の接続を開いていないということです:Sとそれがchを開くとき私はこれを受け取るページの上部にあるローマウィンドウ:

You are using an unsupported command-line flag: --ignore-certificate-errors. Stability and security will suffer.

私は本当にこれがセレンから動作していないが、私はそれが正しい届かない原因になっていると信じています!いくつかの助けpls?!?!?!?!

答えて

1

てみ次のコードを使用し、私はすべての問題の場合に知らせる:

from selenium import webdriver 

chrome_options = webdriver.ChromeOptions() 
chrome_options.add_argument("test-type") 
driver = webdriver.Chrome(chrome_options=chrome_options) 
driver.get('https://www.google.com') 
+0

本当にありがとうございましたので:それは動作しますD:D –

関連する問題