import requests
from lxml import etree
def main():
url = 'https://www.douyin.com/user/MS4wLjABAAAA4N4OrZzTSmCPp8vVAqCeyU215Kav2JgFv2Lfy4DNWRs'
headers = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36'}
response = requests.get(url=url,headers=headers)
html = etree.HTML(response.text)
div_list = html.xpath('//div[@class="e6f3c9aceb6c59ff2df1cef17c3959f3-scss"]')
for i in div_list:
item = {}
item['抖音名称'] = i.xpath('./div[2]//text()')
item['粉丝'] = i.xpath('./div[1]/div[2]/div[1]/div[2]/text()')
item['关注'] = i.xpath('./div[1]/div[2]/div[2]/div[2]/text()')
item['获赞量'] = i.xpath('./div[1]/div[2]/div[3]/div[2]/text()')
print(item)
main()
抖音个人主页的id 怎么解密获得
最新推荐文章于 2025-02-23 04:51:37 发布