9. 实时数据图表分析
2020-12-20 本文已影响0人
BeautifulSoulpy
1. 模拟抖音数据数据分析
2. 抖音数据抓取分析实战
网络模式改为桥接模式;
确保手机上安装了mitm.it 证书;kibana 端口5601 处于开启的状态;es端口9200页开启了;
# u2初始化,连接手机后 会安装ATX等软件
(venv) user1@imooc:~$ python -m uiautomator2 init
# 启动 mitmdump,开启后等一会网络连通
mitmdump -s mitmdump_es.py -p 8889
# 模拟抖音操作获取数据
Python handle_douyin_V0.py
# es查看数据
GET douyin_data_2020-12-20/_search
#--------------------------------------------------------
"hits" : {
"total" : {
"value" : 162,
"relation" : "eq"
},
"hits" : [
{
"_index" : "douyin_data_2020-12-20",
"_type" : "_doc",
"_id" : "uS5_gHYBjBeuvQEsupKg",
"_score" : 1.0,
"_source" : {
"author_user_id" : 58911205861,
"aweme_id" : "6899358497993952516",
"birthday" : "1999-01-01",
"gender" : 1,
"nickname" : "无疑",
"region" : "CN",
"person_desc" : """不提供原视频
谢谢喜欢
所有视频自己拍摄请勿盗取""",
"video_create_time" : "2020-11-26 09:14:45",
"video_desc" : "“年年有风 风吹年年 慢慢即漫漫”",
"mp3_info" : "https://sf6-dycdn-tos.pstatp.com/obj/ies-music/6893455407273298695.mp3",
"video_share_info" : "https://www.iesdouyin.com/share/video/6899358497993952516/?region=CN&mid=6893455406397393677&u_code=0&titleType=title&did=1081562756041373&iid=492228839211720",
"video_forward_info" : {
"aweme_id" : "6899358497993952516",
"comment_count" : 102808,
"digg_count" : 2600256,
"download_count" : 152370,
"forward_count" : 2525,
"lose_comment_count" : 0,
"lose_count" : 0,
"play_count" : 0,
"share_count" : 62716,
"whatsapp_share_count" : 0
},
"crawl_time" : "2020-12-20 14:13:42"
}
},
打开kibana,就可以实时看到抓取到的数据了;