其他分享
首页 > 其他分享> > 爬取b站最受欢迎的纪录片

爬取b站最受欢迎的纪录片

作者:互联网

import requests
import bs4

url = "https://search.bilibili.com/all?keyword=%E7%BA%AA%E5%BD%95%E7%89%87"
header={'User-Agent':""}
de = requests.get(url)
de.text

soup = bs4.BeautifulSoup(de.text,"html.parser")
titles = soup.find_all('div',class_="headline clearfix")
for each in titles:
print(each.a['title'])

标签:纪录片,bs4,text,de,E7%,爬取,url,titles,受欢迎
来源: https://www.cnblogs.com/fxc0210/p/12541735.html