首页 > 其他 > 详细

微博热搜

时间:2020-03-21 18:23:13      阅读:38      评论:0      收藏:0      [点我收藏+]
import requests
from bs4 import BeautifulSoup
r = requests.get("https://s.weibo.com/top/summary")#微博热搜排行榜
soup = BeautifulSoup(r.text, lxml)
items = soup.find(class_="data").find_all(name="tr")
print(置顶.ljust(2, ),items[1].find(class_="td-02").a.string)
for item in items[2:]:
    print(item.find(class_="td-01 ranktop").string.ljust(4, ),item.find(class_="td-02").a.string)

 

技术分享图片

微博热搜

原文:https://www.cnblogs.com/2830454095qqcom/p/12540642.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!