生活随笔
收集整理的這篇文章主要介紹了
24-移动端app数据爬取
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
移動端數據爬取
安裝fiddler
真機安裝fiddler證書
修改手機代理(改成電腦ip,端口設置為fiddler的端口)
上述設置完成后我們就可以使用fiddler抓取手機端的數據了
夜神手機模擬器
移動端數據采集-案例一
找到數據接口
import requests
from lxml
import etree
import jsonurl
= "https://api.douguo.net/recipe/v2/search/0/20"
headers
= {"User-Agent":"Mozilla/5.0 (Linux; Android 5.1.1; LIO-AN00 Build/LIO-AN00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.136 Mobile Safari/537.36","Cookie":"duid=65861350","uuid": "feccc21d-d04b-466c-b276-98c6a7e1acef","Host":"api.douguo.net","language":"zh"
}
data
= {"client": "4","_session": "1599663959153866174309718910","keyword": "下飯菜","order": "0","_vs": "400","type": "0","auto_play_mode": "2","sign_ran": "9ce91f215449bf78a75a4a147d6bcc43",
}
response
= requests
.post
(url
=url
,headers
=headers
,data
=data
).text
response2
= json
.loads
(response
)
print(response2
)
最后我只需要使用字典提取自己需要的數據就行
帶翻頁源碼
import requests
from lxml
import etree
import json
url
= "https://api.douguo.net/recipe/v2/search/%d"+"/20"
for pg
in range(0,100,20):new_url
= format(url
%pg
)headers
= {"User-Agent":"Mozilla/5.0 (Linux; Android 5.1.1; LIO-AN00 Build/LIO-AN00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.136 Mobile Safari/537.36","Cookie":"duid=65861350","uuid": "feccc21d-d04b-466c-b276-98c6a7e1acef","Host":"api.douguo.net","language":"zh"}data
= {"client": "4","_session": "1599663959153866174309718910","keyword": "下飯菜","order": "0","_vs": "400","type": "0","auto_play_mode": "2","sign_ran": "9ce91f215449bf78a75a4a147d6bcc43",}response
= requests
.post
(url
=new_url
,headers
=headers
,data
=data
).textresponse2
= json
.loads
(response
)print(response2
)
1,踩點app- —2,分析app登錄流程-----3,賬號密碼/手機短信----4,圖像驗證碼----5,短信驗證碼-----6,分析登錄接口----7,接口參數/加密算法—8,偽造登錄請求------9,獲取登錄狀態/權限操作/后續擴展。
總結
以上是生活随笔為你收集整理的24-移动端app数据爬取的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。