代码
This commit is contained in:
150
movie.json
150
movie.json
@@ -1,127 +1,127 @@
|
||||
[
|
||||
{
|
||||
"title": "肖申克的救赎",
|
||||
"actor": "无",
|
||||
"quote": "希望让人自由。"
|
||||
"title": "哈利·波特与魔法石",
|
||||
"actor": " Daniel Radcliffe / Emma Watson / Rupert Grint",
|
||||
"quote": "童话世界的开端。"
|
||||
},
|
||||
{
|
||||
"title": "霸王别姬",
|
||||
"actor": "无",
|
||||
"quote": "风华绝代。"
|
||||
"title": "当幸福来敲门",
|
||||
"actor": " 威尔·史密斯 Will Smith ...",
|
||||
"quote": "平民励志片。"
|
||||
},
|
||||
{
|
||||
"title": "泰坦尼克号",
|
||||
"actor": "无",
|
||||
"quote": "失去的才是永恒的。"
|
||||
"title": "龙猫",
|
||||
"actor": " 日高法子 Noriko Hidaka / 坂本千夏 Ch...",
|
||||
"quote": "人人心中都有个龙猫,童年就永远不会消失。"
|
||||
},
|
||||
{
|
||||
"title": "阿甘正传",
|
||||
"actor": "无",
|
||||
"quote": "一部美国近现代史。"
|
||||
"title": "活着",
|
||||
"actor": " 葛优 You Ge / 巩俐 Li Gong / 姜武 Wu Jiang",
|
||||
"quote": "张艺谋最好的电影。"
|
||||
},
|
||||
{
|
||||
"title": "千与千寻",
|
||||
"actor": "无",
|
||||
"quote": "最好的宫崎骏,最好的久石让。"
|
||||
"title": "怦然心动",
|
||||
"actor": " 玛德琳·卡罗尔 Madeline Carroll / 卡...",
|
||||
"quote": "真正的幸福是来自内心深处。"
|
||||
},
|
||||
{
|
||||
"title": "美丽人生",
|
||||
"actor": "无",
|
||||
"quote": "最美的谎言。"
|
||||
"title": "蝙蝠侠:黑暗骑士",
|
||||
"actor": " 克里斯蒂安·贝尔 Christ...",
|
||||
"quote": "无尽的黑暗。"
|
||||
},
|
||||
{
|
||||
"title": "星际穿越",
|
||||
"actor": "无",
|
||||
"quote": "爱是一种力量,让我们超越时空感知它的存在。"
|
||||
"title": "指环王3:王者无敌",
|
||||
"actor": " 伊利亚·伍德 Elijah Wood / 西恩...",
|
||||
"quote": "史诗的终章。"
|
||||
},
|
||||
{
|
||||
"title": "这个杀手不太冷",
|
||||
"actor": "无",
|
||||
"quote": "怪蜀黍和小萝莉不得不说的故事。"
|
||||
"title": "我不是药神",
|
||||
"actor": " 徐峥 Zheng Xu / 王传君 Chuanjun Wang / 周...",
|
||||
"quote": "对我们国家而言,这样的电影多一部是一部。"
|
||||
},
|
||||
{
|
||||
"title": "盗梦空间",
|
||||
"actor": "无",
|
||||
"quote": "诺兰给了我们一场无法盗取的梦。"
|
||||
"title": "乱世佳人",
|
||||
"actor": " 费...",
|
||||
"quote": "Tomorrow is another day."
|
||||
},
|
||||
{
|
||||
"title": "楚门的世界",
|
||||
"actor": "无",
|
||||
"quote": "如果再也不能见到你,祝你早安,午安,晚安。"
|
||||
"title": "让子弹飞",
|
||||
"actor": " 姜文 Wen Jiang / 葛优 You Ge / 周润发 Yun-F...",
|
||||
"quote": "你给我翻译翻译,神马叫做TMD的惊喜。"
|
||||
},
|
||||
{
|
||||
"title": "辛德勒的名单",
|
||||
"actor": "无",
|
||||
"quote": "拯救一个人,就是拯救整个世界。"
|
||||
"title": "飞屋环游记",
|
||||
"actor": " 爱德...",
|
||||
"quote": "最后那些最无聊的事情,才是最值得怀念的。"
|
||||
},
|
||||
{
|
||||
"title": "忠犬八公的故事",
|
||||
"actor": "无",
|
||||
"quote": "永远都不能忘记你所爱的人。"
|
||||
"title": "哈尔的移动城堡",
|
||||
"actor": " 倍赏千惠子 Chieko Baishô / 木村拓...",
|
||||
"quote": "带着心爱的人在天空飞翔。"
|
||||
},
|
||||
{
|
||||
"title": "海上钢琴师",
|
||||
"actor": "无",
|
||||
"quote": "每个人都要走一条自己坚定了的路,就算是粉身碎骨。"
|
||||
"title": "十二怒汉",
|
||||
"actor": " 亨利·方达 Henry Fonda / 马丁...",
|
||||
"quote": "1957年的理想主义。"
|
||||
},
|
||||
{
|
||||
"title": "疯狂动物城",
|
||||
"actor": "无",
|
||||
"quote": "迪士尼给我们营造的乌托邦就是这样,永远善良勇敢,永远出乎意料。"
|
||||
"title": "海蒂和爷爷",
|
||||
"actor": " 阿努克·斯特芬 Anuk Steffen /...",
|
||||
"quote": "如果生活中有什么使你感到快乐,那就去做吧!不要管别人说什么。"
|
||||
},
|
||||
{
|
||||
"title": "三傻大闹宝莱坞",
|
||||
"actor": "无",
|
||||
"quote": "英俊版憨豆,高情商版谢耳朵。"
|
||||
"title": "素媛",
|
||||
"actor": " 薛景求 Kyung-gu Sol / 严志媛 Ji-won Uhm ...",
|
||||
"quote": "受过伤害的人总是笑得最开心,因为他们不愿意让身边的人承受一样的痛苦。"
|
||||
},
|
||||
{
|
||||
"title": "机器人总动员",
|
||||
"actor": "无",
|
||||
"quote": "小瓦力,大人生。"
|
||||
"title": "猫鼠游戏",
|
||||
"actor": " 莱昂纳多·迪卡普里奥 L...",
|
||||
"quote": "骗子大师和执著警探的你追我跑故事。"
|
||||
},
|
||||
{
|
||||
"title": "放牛班的春天",
|
||||
"actor": "无",
|
||||
"quote": "天籁一般的童声,是最接近上帝的存在。"
|
||||
"title": "天空之城",
|
||||
"actor": " 田中真弓 Mayumi Tanaka / 横泽启子 Ke...",
|
||||
"quote": "对天空的追逐,永不停止。"
|
||||
},
|
||||
{
|
||||
"title": "无间道",
|
||||
"actor": "无",
|
||||
"quote": "香港电影史上永不过时的杰作。"
|
||||
"title": "鬼子来了",
|
||||
"actor": " 姜文 Wen Jiang / 香川照之 Teruyuki Kagawa /...",
|
||||
"quote": "对敌人的仁慈,就是对自己残忍。"
|
||||
},
|
||||
{
|
||||
"title": "控方证人",
|
||||
"actor": "无",
|
||||
"quote": "比利·怀德满分作品。"
|
||||
"title": "摔跤吧!爸爸",
|
||||
"actor": " 阿米尔·汗 Aamir Khan / 法缇玛...",
|
||||
"quote": "你不是在为你一个人战斗,你要让千千万万的女性看到女生并不是只能相夫教子。"
|
||||
},
|
||||
{
|
||||
"title": "寻梦环游记",
|
||||
"actor": "无",
|
||||
"quote": "死亡不是真的逝去,遗忘才是永恒的消亡。"
|
||||
"title": "少年派的奇幻漂流",
|
||||
"actor": " 苏拉·沙玛 Suraj Sharma / 伊尔凡·可汗 Irrfan...",
|
||||
"quote": "瑰丽壮观、无人能及的冒险之旅。"
|
||||
},
|
||||
{
|
||||
"title": "大话西游之大圣娶亲",
|
||||
"actor": "无",
|
||||
"quote": "一生所爱。"
|
||||
"title": "钢琴家",
|
||||
"actor": " 艾德里安·布洛迪 Adrien Brod...",
|
||||
"quote": "无"
|
||||
},
|
||||
{
|
||||
"title": "熔炉",
|
||||
"actor": "无",
|
||||
"quote": "我们一路奋战不是为了改变世界,而是为了不让世界改变我们。"
|
||||
"title": "死亡诗社",
|
||||
"actor": " 罗宾·威廉姆斯 Robin Williams / 罗伯...",
|
||||
"quote": "当一个死水般的体制内出现一个活跃的变数时,所有的腐臭都站在了光明的对面。"
|
||||
},
|
||||
{
|
||||
"title": "触不可及",
|
||||
"actor": "无",
|
||||
"quote": "满满温情的高雅喜剧。"
|
||||
"title": "指环王2:双塔奇兵",
|
||||
"actor": " 伊利亚·伍德 Elijah Wood / 西恩...",
|
||||
"quote": "承前启后的史诗篇章。"
|
||||
},
|
||||
{
|
||||
"title": "教父",
|
||||
"actor": "无",
|
||||
"quote": "千万不要记恨你的对手,这样会让你失去理智。"
|
||||
"title": "大话西游之月光宝盒",
|
||||
"actor": " 周星驰 Stephen Chow / 吴孟达 Man Tat Ng...",
|
||||
"quote": "无"
|
||||
},
|
||||
{
|
||||
"title": "末代皇帝",
|
||||
"actor": "无",
|
||||
"quote": "“不要跟我比惨,我比你更惨”再适合这部电影不过了。"
|
||||
"title": "绿皮书",
|
||||
"actor": " 维果·莫腾森 Viggo Mortensen /...",
|
||||
"quote": "去除成见,需要勇气。"
|
||||
}
|
||||
]
|
||||
1
期末/project-10-at-2026-06-11-21-12-ee4e8f5c.json
Normal file
1
期末/project-10-at-2026-06-11-21-12-ee4e8f5c.json
Normal file
File diff suppressed because one or more lines are too long
10
期末/爬豆瓣
10
期末/爬豆瓣
@@ -2,9 +2,9 @@ import requests
|
||||
from bs4 import BeautifulSoup as bs
|
||||
import json
|
||||
headers = {'User-Agent':'Mozilla/5.0(Windows NT 10.0;Win64; x64) AppleWebKit/537.36(KHTML,like Gecko) Chrome/91.0.4472.124 Safari/537.36'}
|
||||
url="https://movie.douban.com/top250?start=0"
|
||||
url="https://movie.douban.com/top250?start=25"
|
||||
data=[]
|
||||
resp = requests.get(url, headers = headers)
|
||||
resp = requests.get(url, headers = headers)
|
||||
resp.encoding='uft-8'
|
||||
soup= bs(resp.text,"html.parser")
|
||||
items= soup.find_all("div",class_="item")
|
||||
@@ -15,11 +15,11 @@ for i in range(len(items)):
|
||||
|
||||
actors=items[i].find("div",class_="bd").get_text().strip()
|
||||
try:
|
||||
actors=actors.split("主演:")[1].split("\n")[0]
|
||||
actors=actors.split("主演:")[1].split("\n")[0]
|
||||
except:
|
||||
actors="无"
|
||||
try:
|
||||
quote=items[i].find("div",class_="bd").find("p",class_="quote").get_text().strip()
|
||||
quote=items[i].find("div", class_="bd").find("p",class_="quote").get_text().strip()
|
||||
except:
|
||||
quote="无"
|
||||
data.append({
|
||||
@@ -30,4 +30,4 @@ for i in range(len(items)):
|
||||
print(data)
|
||||
|
||||
with open("movie.json","w",encoding="utf-8") as f:
|
||||
json.dump(data,f,ensure_ascii=False,indent=4)
|
||||
json.dump(data,f,ensure_ascii=False,indent=4)
|
||||
|
||||
Reference in New Issue
Block a user