博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mitmproxy使用
阅读量:7042 次
发布时间:2019-06-28

本文共 1050 字,大约阅读时间需要 3 分钟。

  hot3.png

最近爬取微信时需要用到mitmproxy, 所以就了解了下, 下面是使用的一些过程

def response(flow):    http_request = flow.request    http_response = flow.response    current_url = http_request.url    cookies = http_request.cookies    logger.info('wx_uin: %s' % cookies.get('wxuin'))    logger.info('biz_id: %s' % http_request.query.get('__biz'))    if http_response.status_code != 200:        return    func_dict = {        'weixin.qq.com/mp/profile_ext?action=home': HomeHandler,        'weixin.qq.com/mp/profile_ext?action=getmsg': ScrollHandler    }    for (key, value) in func_dict.items():        if key in current_url:            try:                handler = value(http_request, http_response)                result = handler.run()            except NotFoundPublicAccount as e:                flow.response.text = e.result            except Exception as e:                logger.error(e)            else:                if result:                    flow.response.text = result            break

启动

mitmdump -s proxy.py -p 8888

在手机代理即可

转载于:https://my.oschina.net/yehun/blog/2983016

你可能感兴趣的文章
Redis——订阅
查看>>
iOS iPhone 开发中的文件读写及数据存储
查看>>
Oracle Database XE
查看>>
RAID磁盘阵列笔记
查看>>
使用hadoop进行大规模数据的全局排序
查看>>
润乾报表实现可重复分组报表及改进
查看>>
集算器实现外键功能的代码示例
查看>>
CloudStack Site-to-Site & Remote Access ××× 应用案例
查看>>
php过滤提交数据 防止sql注入***(6)
查看>>
flv视频网站制作 使用Flex和PHP创建自己的视频应用
查看>>
autofs常见错误
查看>>
【OCP-12c】2019年CUUG OCP 071考试题库(79题)
查看>>
[Redis常用命令]
查看>>
小白把CentOS6.8安装在移动硬盘中
查看>>
控制线程
查看>>
oracle12c 高负载进程
查看>>
随时随地掌上邮,飞邮Android版邮件客户端正式提供试用
查看>>
atom的插件必备
查看>>
MySQL引擎特性GIS-R-TREE
查看>>
elasticsearch优化及查询api
查看>>