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
相关推荐
喵手15 小时前
Python爬虫实战:小红书热门笔记爬虫实战 - 搜索关键词驱动的内容采集指南!MadPrinter16 小时前
Python 异步爬虫实战:FindQC 商品数据爬取系统完整教程喵手17 小时前
Python爬虫实战:数据质量治理实战 - 构建企业级规则引擎与异常检测系统!宇擎智脑科技19 小时前
Crawl4AI:面向大语言模型的开源智能网页爬虫框架深度解析深蓝电商API21 小时前
爬虫数据清洗:Pandas 处理缺失值与异常去码头整点薯条ing1 天前
猿人学第二届第一题【魔改标准算法】喵手1 天前
Python爬虫实战:深度索引 - 基于关键词矩阵模拟与语义打捞的语料库构建实战!喵手1 天前
Python爬虫实战:爬取得到App电子书畅销榜 - 从零到交付的完整实战!tang777892 天前
深挖66免费代理网站:隐藏功能与真实体验报告电商API_180079052472 天前
电商评论数据爬虫:情感分析与数据可视化实战