import itchat
import pandas as pd
# 先登录
itchat.login()
# 获取好友列表
friends = itchat.get_friends(update=True)[0:]
#number_friends = itchat.get_friends(update=True)
number_of_friends = len(friends)
# 初始化计数器,有男有女,当然,有些人是不填的
male = female = other = 0
# 遍历这个列表,列表里第一位是自己
Python3爬虫抓取微信好友数量、性别、以及城市分布等信息。
本文介绍如何使用Python3编写爬虫程序,详细抓取并分析微信好友的数量、性别比例以及地域分布,为个人社交网络提供数据洞察。
摘要由CSDN通过智能技术生成