目的:爬取猫眼电影榜单top100榜中的电影名字、主演、上映时间、上映地区、评分、图片等信息

目标网页:TOP100榜 - 猫眼电影 - 一网打尽好电影 (maoyan.com)    https://maoyan.com/board/4

抓取分析:

1.打开猫眼电影官网,找到榜单栏,初步分析

直接的印象是每页有10个电影,共有10页。显然需要编写某个函数进行翻页

接下来,点击下方数字进行翻页,同时观察页面内容和URL的变化,发现URL多了一个参数offset=10,根据(二)跨门槛——爬虫基础_qq_37821082的博客-CSDN博客中3.1URI格式,我们知道offset属于query ——表示对资源附加的额外要求,通常是以key-value的形式出现,一般都会有很强的规律性。点击第3页,我们发现网页内容变成排名21-30的电影,URL中offset=20,依次翻页分析可知,URL中 offset=(页-1)*10。接下来按功能编写程序即可。

2.先编写抓取第一页的程序,然后通过设置偏移量进行翻页

根据上篇文章(三)夯基础——urllib基本库的使用1.0_猫猫猫耳的博客-CSDN博客的学习,应该很容易就可以写出,就不再赘述了,值得注意的是,在get_one_paper()中,我构建headers时加入了cookie参数,这是因为猫眼电影设置了cookie的反扒机制,不添加的话,抓取不到网页信息。

3.抓取到网页后,进行解析——parse_one_paper()

解析可以通过正则表达式提取,也可以用解析库玩,此次先用基本的正则表达式提取。官方文档——re --- 正则表达式操作 — Python 3.9.6 文档可以结合在线正则表达式测试 (oschina.net)学习

现将这次小项目可能用到的正则表达式和re模块的方法简要说明:

正则表达式:

.*万能匹配"."点可以匹配除换行符之外的任意字符,"*"星代表匹配前面的字符无限次,贪婪模式

.*?非贪婪模式——适合放在字符串中间

re库:

match()函数——从字符串开头开始匹配

re.S修饰符——使.匹配包括换行符的任意字符

re.I修饰符——使匹配对大小写不敏感

提取特定部分()

search()函数——扫描整个字符串,返回第一个匹配成功的结果

findall()函数——获取匹配正则表达式的所有内容,元组类型

sub()函数——修改文本

strip()函数——去除字符串尾部空格

compile()函数——将正则字符串编译成正则表达式对象,以便之后匹配中复用,编译为字节代码

打开网页,按F12查看网页元素,选择Network网络,名称选择第一个,选择响应查看网页源代码,然后根据要爬取的信息保留关键字段以确保能够抓取指定信息。

4.整合代码

值得注意的是,在parse_one_paper()中,items是列表形式,此时已经把要匹配的内容存在了items,后面的遍历列表以字典的形式输出仅仅是为了输出的数据形式更整齐,其中yield是个生成器。

import urllib.request  # 请求发出
import urllib.error  # 异常处理
import time  # 设延时,控制爬虫速度
import re  # 正则表达式
#下面三行为了解决print()输出时出现UnicodeEncodeError: 'gbk' codec can't encode character '\u2022' in position 163: illegal multibyte sequence
import sys
import iosys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='gb18030')def get_one_paper(url):try:headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)'' AppleWebKit/537.36 (KHTML, like Gecko)'' Chrome/92.0.4515.107 Safari/537.36 Edg/92.0.902.62','Referer': 'https://maoyan.com/board','Cookie': '__mta=217954601.1627310792200.1628071203522.1628071204486.169; uuid_n_v=v1; uuid=431B2A30EE2011EBB8370568B89A2432FB52682408E7456FB0382DE7E90BE60D; _lxsdk_cuid=17ae348195dc8-0e2182ceeee18e-7e687a6e-144000-17ae348195dc8; _lxsdk=431B2A30EE2011EBB8370568B89A2432FB52682408E7456FB0382DE7E90BE60D; _csrf=890a745b892e0b56c9b9a7be1db11b6413c3eb04c6da4e93ec4be86f9c466393; _lx_utm=utm_source=bing&utm_medium=organic; Hm_lvt_703e94591e87be68cc8da0da7cbd0be2=1627434469,1627535015,1627916791,1628067661; __mta=217954601.1627310792200.1627916987032.1628067662498.163; Hm_lpvt_703e94591e87be68cc8da0da7cbd0be2=1628071204; _lxsdk_s=17b109b0df3-227-21f-700||5'}req = urllib.request.Request(url, headers=headers)response = urllib.request.urlopen(req)if response.status== 200:return response.read().decode('utf-8')return Noneexcept urllib.error.HTTPError as e:print(e.reason, e.code, e.headers, sep='\n')except urllib.error.URLError as e:print(e.reason)else:return Nonedef parse_one_paper(html):pattern = re.compile('<dd>.*?board-index.*?>(.*?)</i>.*?data-src="(.*?)".*?name.*?a.*?>(.*?)''</a>.*?star.*?>(.*?)</p>.*?releasetime.*?>(.*?)</p>.*?integer.*?>(.*?)''</i>.*?fraction.*?>(.*?)</i>.*?</dd>', re.S)items = re.findall(pattern, html)for item in items:yield {'index': item[0],'image': item[1],'title': item[2].strip(),'actor': item[3].strip()[3:] if len(item[3]) > 3 else '','time': item[4].strip()[5:] if len(item[4]) > 5 else '','score': item[5].strip() + item[6].strip()}def main(offset):url = 'https://maoyan.com/board/4?offset=' + str(offset)html = get_one_paper(url)for item in parse_one_paper(html):# write_to_file(item)print(item)if __name__ == '__main__':for i in range(10):main(offset=i * 10)time.sleep(1)

F:\UsualTasks\PythonPro\venv\Scripts\python.exe F:/UsualTasks/PythonPro/spiders_1.py
{'index': '1', 'image': 'https://p1.meituan.net/movie/2ef746f44aee22bede3ee1012267469c43613.jpg@160w_220h_1e_1c', 'title': '解放1-5(4K)', 'actor': '扬·恩格莱特,芭芭拉·布雷尔斯卡,达尼尔·奥勒布里斯基', 'time': '1970-1971(前苏联)', 'score': '8.4'}
{'index': '2', 'image': 'https://p0.meituan.net/movie/414176cfa3fea8bed9b579e9f42766b9686649.jpg@160w_220h_1e_1c', 'title': '我不是药神', 'actor': '徐峥,周一围,王传君', 'time': '2018-07-05', 'score': '9.6'}
{'index': '3', 'image': 'https://p0.meituan.net/movie/8112a8345d7f1d807d026282f2371008602126.jpg@160w_220h_1e_1c', 'title': '肖申克的救赎', 'actor': '蒂姆·罗宾斯,摩根·弗里曼,鲍勃·冈顿', 'time': '1994-09-10(加拿大)', 'score': '9.5'}
{'index': '4', 'image': 'https://p1.meituan.net/movie/c9b280de01549fcb71913edec05880585769972.jpg@160w_220h_1e_1c', 'title': '绿皮书', 'actor': '维果·莫腾森,马赫沙拉·阿里,琳达·卡德里尼', 'time': '2019-03-01', 'score': '9.5'}
{'index': '5', 'image': 'https://p0.meituan.net/movie/609e45bd40346eb8b927381be8fb27a61760914.jpg@160w_220h_1e_1c', 'title': '海上钢琴师', 'actor': '蒂姆·罗斯,比尔·努恩 ,克兰伦斯·威廉姆斯三世', 'time': '2019-11-15', 'score': '9.3'}
{'index': '6', 'image': 'https://p0.meituan.net/movie/61fea77024f83b3700603f6af93bf690585789.jpg@160w_220h_1e_1c', 'title': '霸王别姬', 'actor': '张国荣,张丰毅,巩俐', 'time': '1993-07-26', 'score': '9.4'}
{'index': '7', 'image': 'https://p1.meituan.net/movie/ac8f0004928fbce5a038a007b7c73cec746794.jpg@160w_220h_1e_1c', 'title': '小偷家族', 'actor': '中川雅也,安藤樱,松冈茉优', 'time': '2018-08-03', 'score': '8.1'}
{'index': '8', 'image': 'https://p0.meituan.net/movie/005955214d5b3e50c910d7a511b0cb571445301.jpg@160w_220h_1e_1c', 'title': '哪吒之魔童降世', 'actor': '吕艳婷,囧森瑟夫,瀚墨', 'time': '2019-07-26', 'score': '9.6'}
{'index': '9', 'image': 'https://p1.meituan.net/movie/580d81a2c78bf204f45323ddb4244b6c6821175.jpg@160w_220h_1e_1c', 'title': '美丽人生', 'actor': '罗伯托·贝尼尼,朱斯蒂诺·杜拉诺,赛尔乔·比尼·布斯特里克', 'time': '2020-01-03', 'score': '9.3'}
{'index': '10', 'image': 'https://p1.meituan.net/movie/6bea9af4524dfbd0b668eaa7e187c3df767253.jpg@160w_220h_1e_1c', 'title': '这个杀手不太冷', 'actor': '让·雷诺,加里·奥德曼,娜塔莉·波特曼', 'time': '1994-09-14(法国)', 'score': '9.4'}
{'index': '11', 'image': 'https://p0.meituan.net/moviemachine/c2496a7290a72eac6081321898c347693550574.jpg@160w_220h_1e_1c', 'title': '盗梦空间', 'actor': '莱昂纳多·迪卡普里奥,渡边谦,约瑟夫·高登-莱维特', 'time': '2010-09-01', 'score': '9.0'}
{'index': '12', 'image': 'https://p0.meituan.net/movie/15f1ac49b6d1ff7b71207672993ed6901536456.jpg@160w_220h_1e_1c', 'title': '怦然心动', 'actor': '玛德琳·卡罗尔,卡兰·麦克奥利菲,艾丹�6�1奎因', 'time': '2010-07-26(美国)', 'score': '8.9'}
{'index': '13', 'image': 'https://p0.meituan.net/movie/b41795c4a88479137e40ebdc3d7dc040238291.jpg@160w_220h_1e_1c', 'title': '阿甘正传', 'actor': '汤姆·汉克斯,罗宾·怀特,加里·西尼斯', 'time': '1994-07-06(美国)', 'score': '9.4'}
{'index': '14', 'image': 'https://p0.meituan.net/movie/30b20139e68c46d02e0893277d633b701292458.jpg@160w_220h_1e_1c', 'title': '千与千寻', 'actor': '柊瑠美,周冬雨,入野自由', 'time': '2019-06-21', 'score': '9.3'}
{'index': '15', 'image': 'https://p0.meituan.net/moviemachine/94138dc0290a74b35786b6e3b8ece8607940668.jpg@160w_220h_1e_1c', 'title': '星际穿越', 'actor': '马修·麦康纳,安妮·海瑟薇,杰西卡·查斯坦', 'time': '2014-11-12', 'score': '9.3'}
{'index': '16', 'image': 'https://p0.meituan.net/movie/59c05effc4755c627901fb7e044d071d851055.jpg@160w_220h_1e_1c', 'title': '楚门的世界', 'actor': '金·凯瑞,劳拉·琳妮,诺亚·艾默里奇', 'time': '1998(罗马尼亚)', 'score': '8.9'}
{'index': '17', 'image': 'https://p0.meituan.net/moviemachine/eb5e33480a3d3b0f813673a33eb556381148211.jpg@160w_220h_1e_1c', 'title': '触不可及', 'actor': '弗朗索瓦·克鲁塞,奥玛·希,安娜·勒尼', 'time': '2011-11-02(法国)', 'score': '9.1'}
{'index': '18', 'image': 'https://p0.meituan.net/movie/b0d986a8bf89278afbb19f6abaef70f31206570.jpg@160w_220h_1e_1c', 'title': '辛德勒的名单', 'actor': '连姆·尼森,拉尔夫·费因斯,本·金斯利', 'time': '1993-11-30(美国)', 'score': '9.2'}
{'index': '19', 'image': 'https://p0.meituan.net/movie/f433a705dd26d96e95ba6582ddccf5ad1159253.jpg@160w_220h_1e_1c', 'title': '寻梦环游记', 'actor': '安东尼·冈萨雷斯,本杰明·布拉特,盖尔·加西亚·贝纳尔', 'time': '2017-11-24', 'score': '9.6'}
{'index': '20', 'image': 'https://p0.meituan.net/moviemachine/8503c98fa2a02df648f6a59448c4c99078837.jpg@160w_220h_1e_1c', 'title': '情书', 'actor': '中山美穗,丰川悦司,酒井美纪', 'time': '1999-03-01', 'score': '8.8'}
{'index': '21', 'image': 'https://p0.meituan.net/movie/aeb864fa21d578d845b9cefc056e40cb2874891.jpg@160w_220h_1e_1c', 'title': '摔跤吧!爸爸', 'actor': '阿米尔·汗,沙克希·坦沃,法缇玛·萨那·纱卡', 'time': '2017-05-05', 'score': '9.8'}
{'index': '22', 'image': 'https://p0.meituan.net/movie/cac99bd00d40586dc49746a6ce9d03ff192723.jpg@160w_220h_1e_1c', 'title': '少年派的奇幻漂流', 'actor': '苏拉·沙玛,伊尔凡·可汗,塔布', 'time': '2012-11-22', 'score': '9.0'}
{'index': '23', 'image': 'https://p1.meituan.net/movie/d28b729ffe72353a72d1e7ef8a9b90591544978.jpg@160w_220h_1e_1c', 'title': '何以为家', 'actor': '赞恩·阿尔·拉菲亚,约丹诺斯·希费罗,博鲁瓦蒂夫·特雷杰·班科尔', 'time': '2019-04-29', 'score': '9.3'}
{'index': '24', 'image': 'https://p0.meituan.net/moviemachine/7707dc3478f9ab26871688f4964ae45d6672925.jpg@160w_220h_1e_1c', 'title': '小丑', 'actor': '华金·菲尼克斯,罗伯特·德尼罗,亚历克·鲍德温', 'time': '2019-10-04(美国)', 'score': '8.6'}
{'index': '25', 'image': 'https://p0.meituan.net/movie/04263651e43c11ce538b180988ff0a5e231189.jpg@160w_220h_1e_1c', 'title': '忠犬八公的故事', 'actor': 'Forest,理查·基尔,琼·艾伦', 'time': '2009-06-13(美国)', 'score': '9.3'}
{'index': '26', 'image': 'https://p0.meituan.net/moviemachine/e7dd6b1f77fba08c1f20a3b20b156621642576.jpg@160w_220h_1e_1c', 'title': '泰坦尼克号', 'actor': '莱昂纳多·迪卡普里奥,凯特·温丝莱特,比利·赞恩', 'time': '1998-04-03', 'score': '9.4'}
{'index': '27', 'image': 'https://p0.meituan.net/moviemachine/e5daa8748733820faab91102bd0bc4507730353.jpg@160w_220h_1e_1c', 'title': '当幸福来敲门', 'actor': '威尔·史密斯,贾登·史密斯,坦迪·牛顿', 'time': '2008-01-17', 'score': '9.3'}
{'index': '28', 'image': 'https://p1.meituan.net/movie/ca4a128a5a54d5b5e35ceba622636c831810197.jpg@160w_220h_1e_1c', 'title': '三傻大闹宝莱坞', 'actor': '阿米尔·汗,黄渤,卡琳娜·卡普', 'time': '2011-12-08', 'score': '9.1'}
{'index': '29', 'image': 'https://p1.meituan.net/movie/b5adcadc67ea24afadc66739bdc9abb33432367.jpg@160w_220h_1e_1c', 'title': '天堂电影院', 'actor': '菲利浦·诺瓦雷,雅克·贝汉,马克·莱昂纳蒂', 'time': '2021-06-11', 'score': '9.3'}
{'index': '30', 'image': 'https://p0.meituan.net/movie/70de97ebb6b5251ecb7c3f6d7a782a7f189340.jpg@160w_220h_1e_1c', 'title': '放牛班的春天', 'actor': '热拉尔·朱尼奥,让-巴蒂斯特·莫尼耶,玛丽·布奈尔', 'time': '2004-10-16', 'score': '8.8'}
{'index': '31', 'image': 'https://p0.meituan.net/movie/c304c687e287c7c2f9e22cf78257872d277201.jpg@160w_220h_1e_1c', 'title': '龙猫', 'actor': '秦岚,糸井重里,岛本须美', 'time': '2018-12-14', 'score': '9.2'}
{'index': '32', 'image': 'https://p1.meituan.net/movie/2a0783b4fd95566568f24adfad2181bb5392280.jpg@160w_220h_1e_1c', 'title': '熔炉', 'actor': '孔刘,郑有美,金智英', 'time': '2011-09-22(韩国)', 'score': '8.8'}
{'index': '33', 'image': 'https://p0.meituan.net/mmdb/b032a09e72fa00f2831d5bf426c8cf82219526.jpg@160w_220h_1e_1c', 'title': '教父', 'actor': '马龙·白兰度,阿尔·帕西诺,詹姆斯·肯恩', 'time': '2015-04-18', 'score': '9.3'}
{'index': '34', 'image': 'https://p0.meituan.net/movie/f8f6b8a6158a1a3d2f2ec8a8f024eef5306692.jpg@160w_220h_1e_1c', 'title': '看不见的客人', 'actor': '马里奥·卡萨斯,阿娜·瓦格纳,何塞·科罗纳多', 'time': '2017-09-15', 'score': '9.4'}
{'index': '35', 'image': 'https://p0.meituan.net/movie/52c8c57caeeaacbeaa3d54eec62023fd483970.jpg@160w_220h_1e_1c', 'title': '头号玩家(3D IMAX)', 'actor': '泰伊·谢里丹,奥利维亚·库克,本·门德尔森', 'time': '2018-03-30', 'score': '9.0'}
{'index': '36', 'image': 'https://p0.meituan.net/movie/5b36b3c840e26e50aa65ea0c164c9903599336.jpg@160w_220h_1e_1c', 'title': '被嫌弃的松子的一生', 'actor': '中谷美纪,永山瑛太,伊势谷友介', 'time': '2006-05-27(日本)', 'score': '8.5'}
{'index': '37', 'image': 'https://p0.meituan.net/movie/8609f509a07d64da4c8bdc58db7a440a369264.jpg@160w_220h_1e_1c', 'title': '活着', 'actor': '葛优,巩俐,牛犇', 'time': '1994-05-17(法国)', 'score': '9.0'}
{'index': '38', 'image': 'https://p1.meituan.net/movie/34d2efaebaa65c92f75ff719314b3015144837.jpg@160w_220h_1e_1c', 'title': '三块广告牌', 'actor': '弗兰西斯·麦克多蒙德,伍迪·哈里森,山姆·洛克威尔', 'time': '2018-03-02', 'score': '8.6'}
{'index': '39', 'image': 'https://p1.meituan.net/movie/0da7ffae67afeb5c63bd2d73efbe664c283994.jpg@160w_220h_1e_1c', 'title': '请以你的名字呼唤我', 'actor': '提莫西·查拉梅,艾米·汉莫,迈克尔·斯图巴', 'time': '2017-01-22(美国)', 'score': '8.0'}
{'index': '40', 'image': 'https://p1.meituan.net/movie/9cf8e45d467cc4da1f7e42f2678219ed129962.jpg@160w_220h_1e_1c', 'title': '死亡诗社', 'actor': '罗宾·威廉姆斯,伊桑·霍克,柯特伍德·史密斯', 'time': '1989-06-02(加拿大)', 'score': '8.7'}
{'index': '41', 'image': 'https://p0.meituan.net/movie/267dd2483f0fb57081474c00fbea38451415571.jpg@160w_220h_1e_1c', 'title': '机器人总动员', 'actor': '本·贝尔特,艾丽莎·奈特,杰夫·格尔林', 'time': '2008-06-27(美国)', 'score': '9.3'}
{'index': '42', 'image': 'https://p1.meituan.net/movie/8d7b0b902afd4ec1a3dd7a9c6149463c187734.jpg@160w_220h_1e_1c', 'title': '闻香识女人', 'actor': '阿尔·帕西诺,克里斯·奥唐纳,加布里埃尔·安瓦尔', 'time': '1992-12-23(美国)', 'score': '8.8'}
{'index': '43', 'image': 'https://p0.meituan.net/moviemachine/92a2d32c3ccfd7f54111b6ae7ff85267256782.webp@160w_220h_1e_1c', 'title': '疯狂动物城', 'actor': '金妮弗·古德温,杰森·贝特曼,伊德瑞斯·艾尔巴', 'time': '2016-03-04', 'score': '9.5'}
{'index': '44', 'image': 'https://p1.meituan.net/moviemachine/eb3656da174dd67880dc465671d77a9a5982174.jpg@160w_220h_1e_1c', 'title': '复仇者联盟4:终局之战', 'actor': '小罗伯特·唐尼,克里斯·埃文斯,马克·鲁法洛', 'time': '2019-04-24', 'score': '9.1'}
{'index': '45', 'image': 'https://p0.meituan.net/moviemachine/081194992e014d3d7ff17aa7d0598179919881.jpg@160w_220h_1e_1c', 'title': '末代皇帝', 'actor': '尊龙,陈冲,彼得·奥图尔', 'time': '1987-10-04(日本)', 'score': '8.8'}
{'index': '46', 'image': 'https://p0.meituan.net/movie/3d5db7fcda3d9f9df772fca36145c35483938.jpg@160w_220h_1e_1c', 'title': '西西里的美丽传说', 'actor': '莫妮卡·安娜·玛丽亚·贝鲁奇,朱塞佩·苏尔法罗,玛蒂尔德·皮亚纳', 'time': '2000-10-26(意大利)', 'score': '8.2'}
{'index': '47', 'image': 'https://p0.meituan.net/movie/3ae02de0ce5504f12cb798b9d4ad0f07371622.jpg@160w_220h_1e_1c', 'title': '让子弹飞', 'actor': '姜文,周润发,葛优', 'time': '2010-12-16', 'score': '8.5'}
{'index': '48', 'image': 'https://p0.meituan.net/movie/15983d78f1450ac2c73a7d4417536714337582.jpg@160w_220h_1e_1c', 'title': '本杰明·巴顿奇事', 'actor': '布拉德·皮特,凯特·布兰切特,塔拉吉·P·汉森', 'time': '2008-12-25(美国)', 'score': '8.8'}
{'index': '49', 'image': 'https://p1.meituan.net/moviemachine/f7086730608eb956c7c27e9eb3b5cc415439205.jpg@160w_220h_1e_1c', 'title': '阿凡达', 'actor': '萨姆·沃辛顿,佐伊·索尔达娜,米歇尔·罗德里格兹', 'time': '2010-01-04', 'score': '9.4'}
{'index': '50', 'image': 'https://p0.meituan.net/movie/b3defc07dfaa1b6f5b74852ce38a3f8f242792.jpg@160w_220h_1e_1c', 'title': '搏击俱乐部', 'actor': '爱德华·哈里森·诺顿,布拉德·皮特,海伦娜·伯翰·卡特', 'time': '1999-09-10(意大利)', 'score': '8.8'}
{'index': '51', 'image': 'https://p0.meituan.net/movie/32ae5d0f25996ec169def65459a0f52f386220.jpg@160w_220h_1e_1c', 'title': '飞屋环游记', 'actor': '爱德华·阿斯纳,乔丹·长井,鲍勃·彼德森', 'time': '2009-08-04', 'score': '8.9'}
{'index': '52', 'image': 'https://p0.meituan.net/movie/ecb99c1c324d6a50bb6c3303e9d49488216865.jpg@160w_220h_1e_1c', 'title': '天使爱美丽', 'actor': '奥黛丽·塔图,马修·卡索维茨,吕菲斯', 'time': '2001-04-25(比利时)', 'score': '8.4'}
{'index': '53', 'image': 'https://p0.meituan.net/moviemachine/38cdf0810cad207ef0917abe4fa1e3ef5788447.jpg@160w_220h_1e_1c', 'title': '心灵奇旅', 'actor': '杰米·福克斯,蒂娜·菲,菲利西亚·拉斯海德', 'time': '2020-12-25', 'score': '9.3'}
{'index': '54', 'image': 'https://p1.meituan.net/movie/757329b238641ca206127656a5f4ec44205272.jpg@160w_220h_1e_1c', 'title': '飞越疯人院', 'actor': '杰克·尼科尔森,路易丝·弗莱彻,威尔·萨姆森', 'time': '1975-11-19(美国)', 'score': '8.8'}
{'index': '55', 'image': 'https://p1.meituan.net/movie/f86c7056a060f9144272d0ad7352fbd3302202.jpg@160w_220h_1e_1c', 'title': '美国往事', 'actor': '罗伯特·德尼罗,詹姆斯·伍兹,伊丽莎白·麦戈文', 'time': '2015-04-23', 'score': '9.1'}
{'index': '56', 'image': 'https://p0.meituan.net/movie/28e51e8dac4bb132a037824227e54df9438711.jpg@160w_220h_1e_1c', 'title': '窃听风暴', 'actor': '乌尔里希·穆埃,塞巴斯蒂安·科赫,马蒂娜·格德克', 'time': '2006-03-23(德国)', 'score': '9.0'}
{'index': '57', 'image': 'https://p0.meituan.net/movie/223c3e186db3ab4ea3bb14508c709400427933.jpg@160w_220h_1e_1c', 'title': '乱世佳人', 'actor': '费雯·丽,克拉克·盖博,奥利维娅·德哈维兰', 'time': '1939-12-15(美国)', 'score': '9.1'}
{'index': '58', 'image': 'https://p1.meituan.net/moviemachine/508056769092059fe43a611b949f27d14863831.jpg@160w_220h_1e_1c', 'title': '大话西游之大圣娶亲', 'actor': '周星驰,朱茵,莫文蔚', 'time': '2014-10-24', 'score': '8.8'}
{'index': '59', 'image': 'https://p0.meituan.net/movie/738840c7fc0d0fa3cd431f57f9d5a195337471.jpg@160w_220h_1e_1c', 'title': '美丽心灵', 'actor': '罗素·克劳,詹妮弗·康纳利,艾德·哈里斯', 'time': '2001-12-13(美国)', 'score': '8.8'}
{'index': '60', 'image': 'https://p0.meituan.net/movie/6cb23356f9d8e0b506349561c633310d102189.jpg@160w_220h_1e_1c', 'title': '一一', 'actor': '吴念真,金燕玲,李凯莉', 'time': '2017-07-28(中国台湾)', 'score': '8.9'}
{'index': '61', 'image': 'https://p0.meituan.net/movie/6ad00fae7818c87d4f4f623ee8708c421368881.jpg@160w_220h_1e_1c', 'title': '消失的爱人', 'actor': '本·阿弗莱克,裴淳华,尼尔·帕特里克·哈里斯', 'time': '2014-09-26(美国)', 'score': '8.7'}
{'index': '62', 'image': 'https://p0.meituan.net/movie/eec5ce0066f81a649c4f7d2ffd353f22272301.jpg@160w_220h_1e_1c', 'title': '蝴蝶效应', 'actor': '约翰·帕特里克·阿梅多利,罗根·勒曼,卡梅隆·布莱特', 'time': '2004-01-23(美国)', 'score': '8.7'}
{'index': '63', 'image': 'https://p0.meituan.net/movie/b6167a97f67993bfef5053f7c78cfdc81986322.jpg@160w_220h_1e_1c', 'title': '布达佩斯大饭店', 'actor': '拉尔夫·费因斯,托尼·雷沃罗利,西尔莎·罗南', 'time': '2014-06-14', 'score': '8.7'}
{'index': '64', 'image': 'https://p0.meituan.net/movie/621a8ea3736dfd97ca9cc05698d9bb71330853.jpg@160w_220h_1e_1c', 'title': '低俗小说', 'actor': '约翰·特拉沃尔塔,乌玛·瑟曼,塞缪尔·杰克逊', 'time': '1994-05-21(法国)', 'score': '8.7'}
{'index': '65', 'image': 'https://p0.meituan.net/movie/14dce6c3d296dd12a1d0841def25162b321241.jpg@160w_220h_1e_1c', 'title': '海边的曼彻斯特', 'actor': '卡西·阿弗莱克,卢卡斯·赫奇斯,米歇尔·威廉姆斯', 'time': '2017-08-25', 'score': '8.8'}
{'index': '66', 'image': 'https://p0.meituan.net/movie/289f98ceaa8a0ae737d3dc01cd05ab052213631.jpg@160w_220h_1e_1c', 'title': '罗马假日', 'actor': '格利高里·派克,奥黛丽·赫本,埃迪·艾伯特', 'time': '1953-08-20(意大利)', 'score': '9.1'}
{'index': '67', 'image': 'https://p0.meituan.net/movie/32958f447a4319a9483c300b2b4e1adc375046.jpg@160w_220h_1e_1c', 'title': '爱在黎明破晓前', 'actor': '伊桑·霍克,朱莉·德尔佩,安德莉亚·埃克特', 'time': '1995-01-27(美国)', 'score': '8.7'}
{'index': '68', 'image': 'https://p1.meituan.net/movie/73c84696b0795c8d0c736857ebac8e951698003.jpg@160w_220h_1e_1c', 'title': '超脱', 'actor': '艾德里安·布洛迪,马西娅·盖伊·哈登,詹姆斯·肯恩', 'time': '2011-04-25(美国)', 'score': '8.7'}
{'index': '69', 'image': 'https://p0.meituan.net/movie/f2a32a5369a76ee11ee37947a0003254629750.jpg@160w_220h_1e_1c', 'title': '海蒂和爷爷', 'actor': '阿努克·斯特芬 ,布鲁诺·甘茨,昆林·艾格匹', 'time': '2019-05-16', 'score': '9.5'}
{'index': '70', 'image': 'https://p0.meituan.net/movie/2e43117ed0e932e71c0e52d7e88588df330131.jpg@160w_220h_1e_1c', 'title': '七宗罪', 'actor': '布拉德·皮特,摩根·弗里曼,格温妮斯·帕特洛', 'time': '1995-09-22(美国)', 'score': '8.7'}
{'index': '71', 'image': 'https://p0.meituan.net/movie/0bd752877b95b8eac2d0704c783f372c4625354.jpg@160w_220h_1e_1c', 'title': '菊次郎的夏天', 'actor': '北野武,关口雄介,岸本 加世子', 'time': '2020-09-25', 'score': '8.8'}
{'index': '72', 'image': 'https://p0.meituan.net/movie/13cc737c14e76278db116cf9210f697a371891.jpg@160w_220h_1e_1c', 'title': '釜山行', 'actor': '孔刘,郑有美,马东锡', 'time': '2016-05-13(法国)', 'score': '8.9'}
{'index': '73', 'image': 'https://p0.meituan.net/movie/606de8f394d40dbcbb9b87943fec71a2130408.jpg@160w_220h_1e_1c', 'title': '无间道', 'actor': '刘德华,梁朝伟,黄秋生', 'time': '2003-09-05', 'score': '9.1'}
{'index': '74', 'image': 'https://p0.meituan.net/moviemachine/cd1906f2ec6a137a5902bfbcbbd5bafd1635014.jpg@160w_220h_1e_1c', 'title': '春光乍泄', 'actor': '张国荣,梁朝伟,张震', 'time': '1997-05-30(中国香港)', 'score': '9.2'}
{'index': '75', 'image': 'https://p1.meituan.net/movie/6a964e9cee699267053bd6a4bf6f2671195394.jpg@160w_220h_1e_1c', 'title': '剪刀手爱德华', 'actor': '约翰尼·德普,薇诺娜·瑞德,黛安娜·维斯特', 'time': '1990-12-06(美国)', 'score': '8.8'}
{'index': '76', 'image': 'https://p1.meituan.net/movie/20b81c48788d6f73a07fec370baabad4103840.jpg@160w_220h_1e_1c', 'title': '爱在日落黄昏时', 'actor': '伊桑·霍克,朱莉·德尔佩,弗农·多布切夫', 'time': '2015-04-20', 'score': '8.7'}
{'index': '77', 'image': 'https://p1.meituan.net/movie/76476c7f8c6de60df8da6efae60c3542399799.jpg@160w_220h_1e_1c', 'title': '心灵捕手', 'actor': '罗宾·威廉姆斯,马特·达蒙,明妮·德里弗', 'time': '1997-12-05(美国)', 'score': '8.4'}
{'index': '78', 'image': 'https://p1.meituan.net/movie/d5970e36c8868a4b746c80f3b3f8a404174615.jpg@160w_220h_1e_1c', 'title': '穿条纹睡衣的男孩', 'actor': '阿沙·巴特菲尔德,维拉·法梅加,大卫·休里斯', 'time': '2008-08-28(英国)', 'score': '9.0'}
{'index': '79', 'image': 'https://p1.meituan.net/movie/389058d95ea9e464d695cd1a8c7e285f440657.jpg@160w_220h_1e_1c', 'title': '辩护人', 'actor': '宋康昊,郭度沅,吴达洙', 'time': '2013-12-18(韩国)', 'score': '8.8'}
{'index': '80', 'image': 'https://p0.meituan.net/movie/107c99a629d860c6206189192e5d4308215794.jpg@160w_220h_1e_1c', 'title': '重庆森林', 'actor': '梁朝伟,王菲,金城武', 'time': '1994-07-14(中国香港)', 'score': '8.6'}
{'index': '81', 'image': 'https://p0.meituan.net/movie/19653e8af59cf473cd40f9ccc0658d93692304.jpg@160w_220h_1e_1c', 'title': '素媛', 'actor': '李甄,薛耿求,严智苑', 'time': '2013-10-02(韩国)', 'score': '9.1'}
{'index': '82', 'image': 'https://p1.meituan.net/movie/ba1ed511668402605ed369350ab779d6319397.jpg@160w_220h_1e_1c', 'title': '天空之城', 'actor': '寺田农,鹫尾真知子,龟山助清', 'time': '1992-05-01', 'score': '9.0'}
{'index': '83', 'image': 'https://p1.meituan.net/movie/d94e5c3054778f6f48bff3a813b0b7cd5300998.jpg@160w_220h_1e_1c', 'title': '波西米亚狂想曲', 'actor': '拉米·马雷克,本·哈迪,约瑟夫�6�1梅泽罗', 'time': '2019-03-22', 'score': '9.4'}
{'index': '84', 'image': 'https://p1.meituan.net/movie/686c2de9e4f416e592d09cb62b32f274390992.jpg@160w_220h_1e_1c', 'title': '断背山', 'actor': '希斯·莱杰,杰克·吉伦哈尔,米歇尔·威廉姆斯', 'time': '2005-09-02(意大利)', 'score': '8.9'}
{'index': '85', 'image': 'https://p0.meituan.net/movie/7d94792dee7ac5964bbcbcd676a98081261728.jpg@160w_220h_1e_1c', 'title': '控方证人', 'actor': '泰隆·鲍华,玛琳·黛德丽,查尔斯·劳顿', 'time': '1957-12-17(美国)', 'score': '8.5'}
{'index': '86', 'image': 'https://p0.meituan.net/movie/09658109acfea0e248a63932337d8e6a4268980.jpg@160w_220h_1e_1c', 'title': '蝙蝠侠:黑暗骑士', 'actor': '克里斯蒂安·贝尔,希斯·莱杰,阿伦·伊克哈特', 'time': '2008-07-14(阿根廷)', 'score': '9.3'}
{'index': '87', 'image': 'https://p0.meituan.net/movie/55d9fcd5bc528636070c0307bac17037405534.jpg@160w_220h_1e_1c', 'title': '时空恋旅人', 'actor': '瑞秋·麦克亚当斯,多姆纳尔·格里森,比尔·奈伊', 'time': '2013-09-04(英国)', 'score': '8.9'}
{'index': '88', 'image': 'https://p0.meituan.net/movie/632e8039ca28809a6ab9d72673f388f3113539.jpg@160w_220h_1e_1c', 'title': '两杆大烟枪', 'actor': '杰森·弗莱明,德克斯特·弗莱彻,杰森�6�1斯坦森', 'time': '1998-08-28(英国)', 'score': '8.7'}
{'index': '89', 'image': 'https://p1.meituan.net/movie/961036f05fdfdd68fecb70fa0c579ca0238954.jpg@160w_220h_1e_1c', 'title': '十二怒汉', 'actor': '亨利·方达,李·科布,马丁·鲍尔萨姆', 'time': '1957-04-13(美国)', 'score': '9.1'}
{'index': '90', 'image': 'https://p1.meituan.net/movie/611821c86367c6d9d0d663047407df59654543.jpg@160w_220h_1e_1c', 'title': '血战钢锯岭', 'actor': '安德鲁·加菲尔德,雨果·维文,卢克·布雷西', 'time': '2016-12-08', 'score': '9.3'}
{'index': '91', 'image': 'https://p0.meituan.net/movie/8834e6905cba927646661ed25e9c95d1136086.jpg@160w_220h_1e_1c', 'title': '猫鼠游戏', 'actor': '莱昂纳多·迪卡普里奥,汤姆·汉克斯,克里斯托弗·沃肯', 'time': '2003-04-11', 'score': '8.6'}
{'index': '92', 'image': 'https://p0.meituan.net/movie/36db8e805a15cc0475ebe3f0c9b56c9e782659.jpg@160w_220h_1e_1c', 'title': '网络谜踪', 'actor': '约翰·赵,米切尔·拉,黛博拉·梅辛', 'time': '2018-12-14', 'score': '8.6'}
{'index': '93', 'image': 'https://p1.meituan.net/movie/11d86a5c644840374c7860f98ef19183264645.jpg@160w_220h_1e_1c', 'title': '真爱至上', 'actor': '休·格兰特,比尔·奈伊,连姆·尼森', 'time': '2003-11-21(英国)', 'score': '8.6'}
{'index': '94', 'image': 'https://p0.meituan.net/movie/e5e49dad53d8cfba7316d486e799345c395906.jpg@160w_220h_1e_1c', 'title': '奇迹男孩', 'actor': '雅各布·特瑞布雷,朱莉娅·罗伯茨,欧文·威尔逊', 'time': '2018-01-19', 'score': '9.2'}
{'index': '95', 'image': 'https://p0.meituan.net/movie/0b1474181d53a328c2e87d018fa088b9241815.jpg@160w_220h_1e_1c', 'title': '大鱼', 'actor': '伊万·麦克格雷格,阿尔伯特·芬尼,杰西卡·兰格', 'time': '2003-12-04(美国)', 'score': '8.6'}
{'index': '96', 'image': 'https://p1.meituan.net/movie/ef83b1e2ef6fa1e6f736521a356b829a334336.jpg@160w_220h_1e_1c', 'title': '致命魔术', 'actor': '休·杰克曼,克里斯蒂安·贝尔,迈克尔·凯恩', 'time': '2006-10-17(意大利)', 'score': '8.8'}
{'index': '97', 'image': 'https://p0.meituan.net/movie/389d81144eab106ac08c870bb4e366be547402.jpg@160w_220h_1e_1c', 'title': '钢琴家', 'actor': '艾德里安·布洛迪,艾米莉娅·福克斯,米哈乌·热布罗夫斯基', 'time': '2002-05-24(法国)', 'score': '8.9'}
{'index': '98', 'image': 'https://p1.meituan.net/movie/8d54378f5aa5891b27da166063fe5efe793583.jpg@160w_220h_1e_1c', 'title': '饮食男女', 'actor': '郎雄,吴倩莲,杨贵媚', 'time': '1994-08-03(美国)', 'score': '8.8'}
{'index': '99', 'image': 'https://p0.meituan.net/moviemachine/8265143afdbafba9d3ad7993bc3472e4508519.jpg@160w_220h_1e_1c', 'title': '模仿游戏', 'actor': '本尼迪克特·康伯巴奇,凯拉·奈特莉,马修·古迪', 'time': '2015-07-21', 'score': '9.3'}
{'index': '100', 'image': 'https://p0.meituan.net/movie/985156d0619734f9eacb45d15e2ba3231323113.jpg@160w_220h_1e_1c', 'title': '禁闭岛', 'actor': '莱昂纳多·迪卡普里奥,马克·鲁法洛,本·金斯利', 'time': '2010-02-13(德国)', 'score': '8.7'}Process finished with exit code 0

小项目1——猫眼Top100 爬取相关推荐

  1. 小项目1——猫眼电影top100(2.0)

    本文是上篇文章--小项目1--猫眼Top100 爬取_猫猫猫耳的博客-CSDN博客的继承和发展,利用requests库发出网页请求,采用3种方法--re.xpath和BeautifulSoup对网页解 ...

  2. scrapy实战项目(简单的爬取知乎项目)

    本项目实现了对知乎用户信息的爬取,并没有用数据库等,只是简单地用一些提取了一些字段然后存储在了一个csv文件中,但是同样可以实现无线爬取,理论上可以实现万级数据的爬取(当然取决于网速了) 其实想爬取知 ...

  3. 爬虫项目3 - 股票数据爬取

    爬虫项目3 - 股票数据爬取 步骤 步骤 爬取股票名和股票列表,使用gucheng网进行爬取,网址: https://hq.gucheng.com/gpdmylb.html import reques ...

  4. 猫眼电影Top100爬取数据(期末项目)

    同学A负责爬取数据存在Exel.详细如下: 1.导入会用到的库,先用win+r输入cmd,用pip工具下载库文件.导入库文件在pycharm的setting->project->Pytho ...

  5. 猫眼电影Top100爬取

    猫眼电影的TOP100榜爬取步骤: 第一步:打开网页猫眼电影榜单网页(https://maoyan.com/board/4) 第二步:打开开发者模式,分析网页源代码,找到需爬取的信息 第三步:编写代码 ...

  6. python爬取微信小程序(实战篇)_python爬取猫眼的前100榜单并展示在微信小程序

    首先分析要爬取的网页,对其结构及数据获取方式解析后,可采用正则筛选自己要的数据 猫眼榜单.png import requests from requests.exceptions import Req ...

  7. 爬虫项目实战九:爬取6间房小视频

    爬取6间房小视频 目标 项目准备 网站分析 页码分析 反爬分析 代码实现 效果显示 目标 爬取6间房小视频,批量保存到本地文件夹. 项目准备 软件:Pycharm 第三方库:requests,fake ...

  8. 猫眼电影票房爬取到MySQL中_猫眼电影爬取(一):requests+正则,并将数据存储到mysql数据库...

    前面讲了如何通过pymysql操作数据库,这次写一个爬虫来提取信息,并将数据存储到mysql数据库 1.爬取目标 爬取猫眼电影TOP100榜单 要提取的信息包括:电影排名.电影名称.上映时间.分数 2 ...

  9. 微信小程序爬虫python_爬虫爬取微信小程序

    之前打算做个微信小程序的社区,所以写了爬虫去爬取微信小程序,后面发现做微信小程序没有前途,就把原来的项目废弃了做了现在的网站观点,不过代码放着也是放着,还不如公开让大家用,所以我把代码贴出来,有需要的 ...

  10. python爬虫项目描述怎么写_爬虫项目咋写,爬取什么样的数据可以作为项目写在简历上?...

    看样子,主要目的是上简历 如果你想要爬虫的offer,那么你的项目应该有这么几个特征: 能用常用的框架,必要时有能力修改框架甚至自己写一个 熟悉多线程多进程分布式等,对爬虫任务调度有很好的解决办法 采 ...

最新文章

  1. eDRX中的Paging
  2. csv文件与字典,列表等之间的转换小结【Python】
  3. nginx php win平台配置
  4. oracle的连接函数,Oracle各种连接函数总结
  5. python可视化的图表汉字显示成框框_Matplotlib图表上输出中文(汉字)、减号问题...
  6. python---subplot函数
  7. input光标高度问题
  8. 系统设计2:数据库设计
  9. Eclipse安装SVN插件和svn连接器
  10. 使用微PE工具进行u盘重装系统
  11. java读取txt文件---,java读取TXT文件的方法
  12. android个人理财通项目实训计划书
  13. linux gif录制工具,Ubuntu中的Gif动画录制工具byzanz
  14. ae插件form_四分钟了解全网最受欢迎的10大AE插件
  15. 2020爬取美赛数学成绩
  16. [乡土民间故事_徐苟三传奇]第八回_张财主误喊“你来看”
  17. iphone7plus启动时icon被拉伸放大的原因
  18. 电池战争:“新石油”与中欧分野
  19. 百度爱采购开户及流程
  20. biobakery流程之有参宏基因组分析

热门文章

  1. Autodesk 3ds Max 渲染之后保存页面卡死问题
  2. Django3 快速入门
  3. 计算机软件编程应聘ppt,[计算机软件及应用]单片机c编程.ppt
  4. 设置国内maven镜像仓库
  5. 三菱f800变频器 频率设定_三菱F800变频器调试参数总结 -
  6. photoshop基础图文教程:第一章 下载与安装
  7. Cameralink学习笔记
  8. matlab 频域采样定理,信号时域和频域采样函数周期性与原信号的关系
  9. JSP基础教程-初时index首页
  10. 保证成功率的方案,首先要从实施维度入手