import requests
from bs4 import BeautifulSoup
def get_actors():
actor_list = []
for i in range(0,10):
link = "http://movie.douban.com/top250?start="+str(i*25)
header = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36 SE 2.X MetaSr 1.0","Host":"movie.douban.com" }
response = requests.get(link,headers = header)
#print(response.status_code)
soup = BeautifulSoup(response.text,"html.parser")
div_list = soup.find_all('div',class_='bd')
for each in div_list:
actor = each.p.text.strip()
actor_list.append(actor)
return actor_list
actors = get_actors()
print(actors)
第一个爬虫:获取演员表
FrankHuang8882024-04-27 15:07
相关推荐
傻啦嘿哟7 小时前
高德地图POI爬虫:爬取商户与景点数据,做LBS应用weixin199701080168 小时前
官方授权通道和灰色爬虫,做数据服务该选哪条路(附 python 源码)正飞信息技术1 天前
llms.txt部署指南:给AI爬虫一张清晰的网站地图NeoGressAI外贸数字化3 天前
外贸独立站robots.txt怎么写:6个AI爬虫放行规则OnlineProxy3 天前
移动应用数据爬取:通过模拟器与流量嗅探对 API 进行逆向工程傻啦嘿哟3 天前
分布式爬虫架构:Redis+Scrapy打造企业级爬虫系统梯度下降者4 天前
零基础入门Python 爬虫2601_967979124 天前
0 到 1 学爬虫:用 Python 爬取网页数据指南一(附实战案例)姚瑞南4 天前
【PRD】招投标商机雷达爬虫系统嫂子的姐夫5 天前
055-wasm:爬虫练习网spa15(token 纯算还原)