Python爬取Telegram群组成员数据实践指南
流量次数: 作者:tg纸飞机 发布时间:2025-08-09 23:34
from telethon.tl.functions.channels import GetParticipantsRequest
from telethon.tl.types import ChannelParticipantsSearch
api_id = 'YOUR_API_ID'
api_hash = 'YOUR_API_HASH'
phone = '+YOUR_PHONE_NUMBER'
group_username = '目标群组用户名或ID'
with TelegramClient('session_name', api_id, api_hash) as client:
client.start(phone)
group = client.get_entity(group_username)
participants = client(GetParticipantsRequest(
group,
ChannelParticipantsSearch(''),
offset=0,
limit=100,
hash=0
))
for user in participants.users:
print(user.id, user.first_name, user.last_name)
tags标签:Tg软件(10)纸飞机TG下载(13)
本文章来自(https://www.cdjggs.com),转载请说明出处!
下一篇:没有了