上一篇讲到手机自动点击微信公众号的文章
这里看看怎么获取微信公众号文章的链接:
下载 Filddler 软件,官网:/link?url=PwyEnPhQeT7ne2B4e0K6ZUI96KahSOJReqT8zhdu-jRlAec3A9x36ekApkV9BKJt&wd=&eqid=80efe2240016db99000000065dad5744打开手机 wifi,使手机和电脑在同一局域网(简单的就是手机和电脑连同一个 wifi);打开电脑命令行 cmd,输入 ipconfig 查看 IPv4 地址:
手机上设置此 wifi 的—>显示高级设置—>代理(手动)—>服务器主机名(命令查出的ipv4地址(本机是192.168.31.22))—>服务器端口(8888):fiddler默认配置—>保存
然后 在手机浏览器上访问:192.168.31.22:8888
点击 FiddlerRoot certificate 下载,然后按步骤添加->设置锁屏密码,ok啦~~同时在fiddler上也能看到 访问的这个 192.168.31.22:8888 链接:
在fiddler的FiddlerScript中增加一段代码用于将抓取的微信公众号的链接保存到本地的txt文件中:
if (oSession.HostnameIs("mp.") && oSession.uriContains("/mp/geticon?")){var curDate = new Date();var date = new Date(),y = date.getFullYear(),m = date.getMonth() + 1,d = date.getDate(),h = date.getHours();if (m < 10) m = "0" + m;var formateTime = y + "-" + m + "-" + d;// if (h<13) {formateTime = formateTime + "-morning";}// else {formateTime = formateTime + "-afternoon";}var filename = "D:/gzh_url/url"+formateTime+".txt";var logContent = 'cc' + "[" + curDate.toLocaleString() + "]";// var wap_s = oSession.oRequest.headers// var wap_sid2 = pile(r"wap_sid2=(.*?)Q-UA").findall(wap_s)var sw: System.IO.StreamWriter;if (System.IO.File.Exists(filename)){sw = System.IO.File.AppendText(filename);// referer = oSession.oRequest.headers.ExistsAndContains("Referer","https://mp./s?__biz")// sw.Write(logContent + 'oSession.oRequest.headers-->' + oSession.oRequest.headers + '-->' + oSession.url + '-->');// sw.Write(oSession.url);// sw.Write("Request header:" + "\n" + oSession.oRequest.headers);// sw.Write('\n')sw.Write(logContent+'-->'+oSession.oRequest.headers['Referer'])sw.Write('\n')}else{sw = System.IO.File.CreateText(filename);// sw.Write(oSession.url);// sw.Write(logContent + 'oSession.oRequest.headers-->' + oSession.oRequest.headers + '-->' + oSession.url);// sw.Write("Request header:" + "\n" + oSession.oRequest.headers);// sw.Write(wap_s + '\n\n')sw.Write(logContent+'-->'+oSession.oRequest.headers['Referer'])sw.Write('\n')}sw.Close();sw.Dispose();}
效果如下:
与上篇文章可以一块进行测试,手机依旧连着 usb,运行 monkeyrunner.bat phone.py 然后可以在fiddler上看到抓取的文章链接,以及保存的url文件