AttributeError: module ‘asyncio‘ has no attribute ‘WindowsSelectorEventLoopPolicy‘

一、解决办法
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

二、本人出现场景爬虫抓包windos: 评论区给的是正解切换版本 pip install mitmproxy==5.0.1

本人装 pip install mitmproxy 完全ok
启动服务 mitmdump,报如下错误

asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
AttributeError: module 'asyncio' has no attribute 'WindowsSelectorEventLoopPolicy'

于是我把上面个那个方法进行使用, 加上去了, 针对我这个应用场景然并卵(此处是个坑,下面会讲到)

解决办法下面文件夹下的代码我给注了.

在这里插入图片描述###### 重新启动服务mitmdump然后添加证书 手机端 网址 mitm.it 选择对应设备ok抓到相应的包啦

在这里插入图片描述

你以为ok啦, 如果要求不高,确实ok啦, 实则太难看了

于是我又想进行抓包可视化页面mitmweb,又tm 报错这个

    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
AttributeError: module 'asyncio' has no attribute 'WindowsSelectorEventLoopPolicy'

于是 这个几个文件加我又看看源码,发现上面原来加上的代码给注释掉,终于运行啦
在这里插入图片描述
在这里插入图片描述

如果对你有帮助,点个赞再走呗

主要我太不容易啦

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

风华浪浪

讨个老婆本呗

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值