2830454095qqcom
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)

 

分类:

技术点:

相关文章:

  • 2021-12-08
  • 2021-10-10
  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
  • 2021-08-31
  • 2021-10-20
  • 2021-11-28
猜你喜欢
  • 2021-10-10
  • 2021-11-28
  • 2021-10-23
  • 2021-08-31
  • 2021-06-30
  • 2021-09-04
相关资源
相似解决方案