seleniumを使って IE11で指定urlを開くだけのコードですが、webdriverを読み込んだ時点で[WinError 10054]が出ているようです。
色々調べましたが解決できません。
お忙しいところ恐れ入りますが、よろしく御願いします。
python3
1 2from selenium import webdriver # webdriver の情報 3from time import sleep 4 5driver = webdriver.Ie(r"D:\web_driver\IEDriverServer_x64_3.9.0\IEDriverServer.exe") #IEドライバのセットアップ 6 7sleep(3) 8driver.get("http://tdc-srv2:8080/Web3s/FinFileDefault.aspx")#Web 情報を取得(Web ブラウザを開く) 9driver.close()#IEドライバを閉じる 10
python
1--------------------------------------------------------------------------- 2ConnectionResetError Traceback (most recent call last) 3<ipython-input-15-f2a8f501f2b2> in <module>() 4 25 from time import sleep 5 26 6---> 27 driver = webdriver.Ie(r"D:\web_driver\IEDriverServer_x64_3.9.0\IEDriverServer.exe") #IEドライバのセットアップ 7 28 #driver = webdriver.Ie(r"D:\web_driver\IEDriverServer_Win32_3.9.0\IEDriverServer.exe") #IEドライバのセットアップ 8 29 sleep(3) 9 10C:\ProgramData\Anaconda3\lib\site-packages\selenium-3.13.0-py3.6.egg\selenium\webdriver\ie\webdriver.py in __init__(self, executable_path, capabilities, port, timeout, host, log_level, log_file, options, ie_options, desired_capabilities) 11 86 self, 12 87 command_executor='http://localhost:%d' % self.port, 13---> 88 desired_capabilities=capabilities) 14 89 self._is_remote = False 15 90 16 17C:\ProgramData\Anaconda3\lib\site-packages\selenium-3.13.0-py3.6.egg\selenium\webdriver\remote\webdriver.py in __init__(self, command_executor, desired_capabilities, browser_profile, proxy, keep_alive, file_detector, options) 18 154 warnings.warn("Please use FirefoxOptions to set browser profile", 19 155 DeprecationWarning) 20--> 156 self.start_session(capabilities, browser_profile) 21 157 self._switch_to = SwitchTo(self) 22 158 self._mobile = Mobile(self) 23 24C:\ProgramData\Anaconda3\lib\site-packages\selenium-3.13.0-py3.6.egg\selenium\webdriver\remote\webdriver.py in start_session(self, capabilities, browser_profile) 25 249 parameters = {"capabilities": w3c_caps, 26 250 "desiredCapabilities": capabilities} 27--> 251 response = self.execute(Command.NEW_SESSION, parameters) 28 252 if 'sessionId' not in response: 29 253 response = response['value'] 30 31C:\ProgramData\Anaconda3\lib\site-packages\selenium-3.13.0-py3.6.egg\selenium\webdriver\remote\webdriver.py in execute(self, driver_command, params) 32 316 33 317 params = self._wrap_value(params) 34--> 318 response = self.command_executor.execute(driver_command, params) 35 319 if response: 36 320 self.error_handler.check_response(response) 37 38C:\ProgramData\Anaconda3\lib\site-packages\selenium-3.13.0-py3.6.egg\selenium\webdriver\remote\remote_connection.py in execute(self, command, params) 39 470 data = utils.dump_json(params) 40 471 url = '%s%s' % (self._url, path) 41--> 472 return self._request(command_info[0], url, body=data) 42 473 43 474 def _request(self, method, url, body=None): 44 45C:\ProgramData\Anaconda3\lib\site-packages\selenium-3.13.0-py3.6.egg\selenium\webdriver\remote\remote_connection.py in _request(self, method, url, body) 46 532 opener = url_request.build_opener(url_request.HTTPRedirectHandler(), 47 533 HttpErrorHandler()) 48--> 534 resp = opener.open(request, timeout=self._timeout) 49 535 statuscode = resp.code 50 536 if not hasattr(resp, 'getheader'): 51 52C:\ProgramData\Anaconda3\lib\urllib\request.py in open(self, fullurl, data, timeout) 53 524 req = meth(req) 54 525 55--> 526 response = self._open(req, data) 56 527 57 528 # post-process response 58 59C:\ProgramData\Anaconda3\lib\urllib\request.py in _open(self, req, data) 60 542 protocol = req.type 61 543 result = self._call_chain(self.handle_open, protocol, protocol + 62--> 544 '_open', req) 63 545 if result: 64 546 return result 65 66C:\ProgramData\Anaconda3\lib\urllib\request.py in _call_chain(self, chain, kind, meth_name, *args) 67 502 for handler in handlers: 68 503 func = getattr(handler, meth_name) 69--> 504 result = func(*args) 70 505 if result is not None: 71 506 return result 72 73C:\ProgramData\Anaconda3\lib\urllib\request.py in http_open(self, req) 74 1344 75 1345 def http_open(self, req): 76-> 1346 return self.do_open(http.client.HTTPConnection, req) 77 1347 78 1348 http_request = AbstractHTTPHandler.do_request_ 79 80C:\ProgramData\Anaconda3\lib\urllib\request.py in do_open(self, http_class, req, **http_conn_args) 81 1319 except OSError as err: # timeout error 82 1320 raise URLError(err) 83-> 1321 r = h.getresponse() 84 1322 except: 85 1323 h.close() 86 87C:\ProgramData\Anaconda3\lib\http\client.py in getresponse(self) 88 1329 try: 89 1330 try: 90-> 1331 response.begin() 91 1332 except ConnectionError: 92 1333 self.close() 93 94C:\ProgramData\Anaconda3\lib\http\client.py in begin(self) 95 295 # read until we get a non-100 response 96 296 while True: 97--> 297 version, status, reason = self._read_status() 98 298 if status != CONTINUE: 99 299 break 100 101C:\ProgramData\Anaconda3\lib\http\client.py in _read_status(self) 102 256 103 257 def _read_status(self): 104--> 258 line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") 105 259 if len(line) > _MAXLINE: 106 260 raise LineTooLong("status line") 107 108C:\ProgramData\Anaconda3\lib\socket.py in readinto(self, b) 109 584 while True: 110 585 try: 111--> 586 return self._sock.recv_into(b) 112 587 except timeout: 113 588 self._timeout_occurred = True 114 115ConnectionResetError: [WinError 10054] 既存の接続はリモート ホストに強制的に切断されました。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/08/22 13:47 編集
2018/08/22 15:43