asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
AttributeError: module 'asyncio' has no attribute 'WindowsSelectorEventLoopPolicy'
这个文件夹
tornado/platform/asyncio.py :
import sys
if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
https://github.com/tornadoweb/tornado/issues/2751
https://www.tornadoweb.org/en/stable/index.html#installation
本人装 pip install mitmproxy
完全ok
mitmdump
File "C:\Users\allve\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\allve\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 85, in _run_code exec(code, run_globals)
File"C:\Users\allve\PycharmProjects\rainbow\venv\Scripts\mitmdump.exe\__main__.py", line 4, in <module>
File "c:\users\allve\pycharmprojects\rainbow\venv\lib\site-packages\mitmproxy\__init__.py", line 8, in <module>
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
AttributeError: module 'asyncio' has no attribute 'WindowsSelectorEventLoopPolicy'
于是我把上面个那个方法进行使用, 加上去了, 针对我这个应用场景然并卵(此处是个坑,下面会讲到)
File "c:\users\allve\pycharmprojects\rainbow\venv\lib\site-packages\mitmproxy\__init__.py", line 8, in <module>
mitmdump
然后添加证书 手机端 网址 mitm.it 选择对应设备ok抓到相应的包啦
于是我又想进行抓包可视化页面
mitmweb
又tm 报错这个
File "C:\Users\allve\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\allve\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\allve\PycharmProjects\rainbow\venv\Scripts\mitmweb.exe\__main__.py", line 7, in <module>
File "c:\users\allve\pycharmprojects\rainbow\venv\lib\site-packages\mitmproxy\tools\_main.py", line 171, in mitmweb
from mitmproxy.tools import web
File "c:\users\allve\pycharmprojects\rainbow\venv\lib\site-packages\mitmproxy\tools\web\__init__.py", line 1, in <module>
from mitmproxy.tools.web import master
File "c:\users\allve\pycharmprojects\rainbow\venv\lib\site-packages\mitmproxy\tools\web\master.py", line 3, in <module>
from tornado.platform.asyncio import AsyncIOMainLoop
File "c:\users\allve\pycharmprojects\rainbow\venv\lib\site-packages\tornado\platform\asyncio.py", line 38, in <module>
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
AttributeError: module 'asyncio' has no attribute 'WindowsSelectorEventLoopPolicy'
于是 这个几个文件加我又看看源码,发现
上面原来加上的代码给注释掉,终于运行啦
如果对你有帮助,点个赞再走呗
主要我太不容易啦