3

Python爬虫编程思想(120):抓取移动App数据--在移动端安装mitmproxy证书

 2 years ago
source link: https://blog.csdn.net/nokiaguy/article/details/122570397
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Python爬虫编程思想(120):抓取移动App数据--在移动端安装mitmproxy证书

专栏收录该内容
126 篇文章 6 订阅 ¥29.90 ¥99.00

        只有在需要监听的手机上安装并信任mitmproxy证书,才能监听HTTPS请求的数据。首先需要将mitmproxy-ca-cert.pem文件上传到手机上,本文以iPhone7为例。读者可以将mitmproxy-ca-cert.pem文件通过发送邮件的方式发送到iPhone,不过有一些邮件客户端打开pem文件有问题。所以可以直接在iPhone浏览器中下载。iPhone必须与PC在同一个网段,然后可以用Python编写一个简单的Web程序,将mitmproxy-ca-cert.pem文件作为静态资源放到static目录中,这样在iPhone浏览器中就可以直接下载了。

Web程序的代码如下:

Web程序和静态资源的目录结构如图1所示。其中server.py是Web程序。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK