if name == "main":
asyncio.get_event_loop().run_until_complete(getProxies_ssr_proxy_socks5())
结果:
True 60.0
2021-04-08 23:16:14,355 - logger.py[line:53] - [main] - INFO: Func - _shadowsocksr_lic Total time: 0.01s
2021-04-08 23:16:16,611 - handle_utils.py[line:69] - [start_on_windows] - INFO: Shadowsocksr is start on 127.0.0.1:999
2021-04-08 23:16:16,613 - handle_utils.py[line:70] - [start_on_windows] - INFO: Press Ctrl+C to stop shadowsocksr
Traceback (most recent call last):
File "D:/MyProject/MyEcProject/Mytest/test_pyppeteer.py", line 123, in
asyncio.get_event_loop().run_until_complete(getProxies_ssr_proxy_socks5())
File "C:\Users\ligen\AppData\Local\Programs\Python\Python37\lib\asyncio\base_events.py", line 568, in run_until_complete
return future.result()
File "D:/MyProject/MyEcProject/Mytest/test_pyppeteer.py", line 115, in getProxies_ssr_proxy_socks5
browser = await launch(start_parm)
File "D:\MyPython\venv\lib\site-packages\pyppeteer\launcher.py", line 305, in launch
return await Launcher(options, kwargs).launch()
File "D:\MyPython\venv\lib\site-packages\pyppeteer\launcher.py", line 166, in launch
self.browserWSEndpoint = get_ws_endpoint(self.url)
File "D:\MyPython\venv\lib\site-packages\pyppeteer\launcher.py", line 227, in get_ws_endpoint
with urlopen(url) as f:
File "C:\Users\ligen\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "C:\Users\ligen\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 525, in open
response = self._open(req, data)
File "C:\Users\ligen\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 543, in _open
'_open', req)
File "C:\Users\ligen\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 503, in _call_chain
result = func(*args)
File "C:\Users\ligen\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 1345, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "C:\Users\ligen\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 1320, in do_open
r = h.getresponse()
File "C:\Users\ligen\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 1321, in getresponse
response.begin()
File "C:\Users\ligen\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 296, in begin
version, status, reason = self._read_status()
File "C:\Users\ligen\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 265, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response
你好,想请教问一个问题,因为对底层逻辑不是很懂,不清楚是不是因为运行你的代码的时候导致本地端口被占用还是什么原因。就是我先调用了你的这个包来创建一个ssr连接以后,再创建一个pyppeteer 的网页访问时,会报错网络端口无法访问,代码结构大概是这样的: 代码:
async def getProxies_ssr_proxy_socks5():
if name == "main": asyncio.get_event_loop().run_until_complete(getProxies_ssr_proxy_socks5())
结果:
True 60.0 2021-04-08 23:16:14,355 - logger.py[line:53] - [main] - INFO: Func - _shadowsocksr_lic Total time: 0.01s 2021-04-08 23:16:16,611 - handle_utils.py[line:69] - [start_on_windows] - INFO: Shadowsocksr is start on 127.0.0.1:999 2021-04-08 23:16:16,613 - handle_utils.py[line:70] - [start_on_windows] - INFO: Press Ctrl+C to stop shadowsocksr Traceback (most recent call last): File "D:/MyProject/MyEcProject/Mytest/test_pyppeteer.py", line 123, in
asyncio.get_event_loop().run_until_complete(getProxies_ssr_proxy_socks5())
File "C:\Users\ligen\AppData\Local\Programs\Python\Python37\lib\asyncio\base_events.py", line 568, in run_until_complete
return future.result()
File "D:/MyProject/MyEcProject/Mytest/test_pyppeteer.py", line 115, in getProxies_ssr_proxy_socks5
browser = await launch(start_parm)
File "D:\MyPython\venv\lib\site-packages\pyppeteer\launcher.py", line 305, in launch
return await Launcher(options, kwargs).launch()
File "D:\MyPython\venv\lib\site-packages\pyppeteer\launcher.py", line 166, in launch
self.browserWSEndpoint = get_ws_endpoint(self.url)
File "D:\MyPython\venv\lib\site-packages\pyppeteer\launcher.py", line 227, in get_ws_endpoint
with urlopen(url) as f:
File "C:\Users\ligen\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "C:\Users\ligen\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 525, in open
response = self._open(req, data)
File "C:\Users\ligen\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 543, in _open
'_open', req)
File "C:\Users\ligen\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 503, in _call_chain
result = func(*args)
File "C:\Users\ligen\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 1345, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "C:\Users\ligen\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 1320, in do_open
r = h.getresponse()
File "C:\Users\ligen\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 1321, in getresponse
response.begin()
File "C:\Users\ligen\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 296, in begin
version, status, reason = self._read_status()
File "C:\Users\ligen\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 265, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response
Process finished with exit code 1
麻烦有空的时候帮忙指点下,感谢。。