requests实战之豆瓣电影

import requests
import json
if __name__ == "__main__":
    headers={
        'user-agent': 'Mozilla / 5.0(Windows NT 10.0;Win64;x64) AppleWebKit / 537.36(KHTML, likeGecko) Chrome / 88.0.4324.150Safari / 537.36'
    }
    url = "https://movie.douban.com/j/chart/top_list"
    param={
        'type': '24',
        'interval_id': '100:90',
        'action':'',
        'start': '0',
        'limit': '20',
    }
    response = requests.get(url=url,params=param,headers=headers)
    list_data = response.json()
    fp = open('./douban.json','w',encoding='utf-8')
    json.dump(list_data,fp=fp,ensure_ascii=False)
    print("Over!!!")


爬取结果:

[{"rating": ["9.6", "50"], "rank": 1, "cover_url": "https://img9.doubanio.com/view/photo/s_ratio_poster/public/p2354179225.jpg", "is_playable": false, "id": "5133063", "types": ["喜剧"], "regions": ["英国"], "title": "憨豆先生精选辑", "url": "https://movie.douban.com/subject/5133063/", "release_date": "1997", "actor_count": 8, "vote_count": 6635, "score": "9.6", "actors": ["罗温·艾金森", "保罗·布朗", "理查德·布赖尔斯", "安格斯·迪顿", "罗宾·德里斯科尔", "卡罗琳·昆汀", "鲁道夫·沃克尔", "理查德·威尔逊"], "is_watched": false}, {"rating": ["9.5", "50"], "rank": 2, "cover_url": "https://img2.doubanio.com/view/photo/s_ratio_poster/public/p2578474613.jpg", "is_playable": true, "id": "1292063", "types": ["剧情", "喜剧", "爱情", "战争"], "regions": ["意大利"], "title": "美丽人生", "url": "https://movie.douban.com/subject/1292063/", "release_date": "2020-01-03", "actor_count": 29, "vote_count": 1056342, "score": "9.5", "actors": ["罗伯托·贝尼尼", "尼可莱塔·布拉斯基", "乔治·坎塔里尼", "朱斯蒂诺·杜拉诺", "赛尔乔·比尼·布斯特里克", "玛丽萨·帕雷德斯", "霍斯特·布赫霍尔茨", "利迪娅·阿方西", "朱利亚娜·洛约迪切", "亚美利哥·丰塔尼", "彼得·德·席尔瓦", "弗朗西斯·古佐", "拉法埃拉·莱博罗尼", "克劳迪奥·阿方西", "吉尔·巴罗尼", "马西莫·比安奇", "恩尼奥·孔萨尔维", "吉安卡尔洛·科森蒂诺", "阿伦·克雷格", "汉尼斯·赫尔曼", "弗兰科·梅斯科利尼", "安东尼奥·普雷斯特", "吉娜·诺维勒", "理查德·塞梅尔", "安德烈提多娜", "迪尔克·范登贝格", "奥梅罗·安东努蒂", "沈晓谦", "张欣"], "is_watched": false}, {"rating": ["9.5", "50"], "rank": 3, "cover_url": "https://img1.doubanio.com/view/photo/s_ratio_poster/public/p2206737207.jpg", "is_playable": true, "id": "1303408", "types": ["喜剧", "动作", "爱情"], "regions": ["美国"], "title": "福尔摩斯二世", "url": "https://movie.douban.com/subject/1303408/", "release_date": "1924-04-21", "actor_count": 11, "vote_count": 17968, "score": "9.5", "actors": ["巴斯特·基顿", "凯瑟琳·麦奎尔", "乔·基顿", "Ward Crane", "Jane Connelly", "George Davis", "Doris Deane", "Betsy Ann Hisle", "丘比·摩根", "John Patrick", "Ford West"], "is_watched": false}, {"rating": ["9.5", "50"], "rank": 4, "cover_url": "https://img1.doubanio.com/view/photo/s_ratio_poster/public/p2527089368.jpg", "is_playable": false, "id": "30203557", "types": ["喜剧"], "regions": ["中国香港"], "title": "黄子华栋笃笑之金盆𠺘口", "url": "https://movie.douban.com/subject/30203557/", "release_date": "2018-07-06", "actor_count": 1, "vote_count": 2401, "score": "9.5", "actors": ["黄子华"], "is_watched": false}, {"rating": ["9.4", "50"], "rank": 5, "cover_url": "https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2509440210.jpg", "is_playable": false, "id": "26700818", "types": ["喜剧", "同性"], "regions": ["英国"], "title": "极品基老伴:完结篇", "url": "https://movie.douban.com/subject/26700818/", "release_date": "2016-06-19", "actor_count": 10, "vote_count": 20915, "score": "9.4", "actors": ["伊恩·麦克莱恩", "德里克·雅各比", "弗朗西斯·德·拉·图瓦", "伊万·瑞恩", "玛西娅·沃伦", "菲利普-沃斯", "艾琳·阿特金斯", "弗兰西斯·巴贝", "阿利斯泰尔·布拉默", "理查德·加德"], "is_watched": false}, {"rating": ["9.4", "50"], "rank": 6, "cover_url": "https://img1.doubanio.com/view/photo/s_ratio_poster/public/p2529714509.jpg", "is_playable": false, "id": "2054458", "types": ["剧情", "喜剧", "动画"], "regions": ["美国"], "title": "拽妹黛薇儿要上大学了没", "url": "https://movie.douban.com/subject/2054458/", "release_date": "2002-01-21", "actor_count": 9, "vote_count": 1971, "score": "9.4", "actors": ["John Lynn", "Amir Williams", "马克·汤普森", "Becca Lish", "温迪胡普斯", "莎拉·德鲁", "Bart Fasbender", "费舍·史蒂芬斯", "吉奥弗瑞·阿伦德"], "is_watched": false}, {"rating": ["9.3", "50"], "rank": 7, "cover_url": "https://img1.doubanio.com/view/photo/s_ratio_poster/public/p2553104888.jpg", "is_playable": false, "id": "1291858", "types": ["剧情", "喜剧"], "regions": ["中国大陆"], "title": "鬼子来了", "url": "https://movie.douban.com/subject/1291858/", "release_date": "2000-05-12", "actor_count": 19, "vote_count": 489015, "score": "9.3", "actors": ["姜文", "香川照之", "袁丁", "姜宏波", "丛志军", "李从喜", "泽田谦也", "李海滨", "蔡卫东", "陈述", "陈莲梅", "史建全", "陈强", "宫路佳具", "吴大维", "梶冈润一", "石山雄大", "述平", "姜武"], "is_watched": false}, {"rating": ["9.3", "50"], "rank": 8, "cover_url": "https://img1.doubanio.com/view/photo/s_ratio_poster/public/p2263408369.jpg", "is_playable": true, "id": "1294371", "types": ["剧情", "喜剧", "爱情"], "regions": ["美国"], "title": "摩登时代", "url": "https://movie.douban.com/subject/1294371/", "release_date": "1936-02-25", "actor_count": 37, "vote_count": 226673, "score": "9.3", "actors": ["查理·卓别林", "宝莲·高黛", "亨利·伯格曼", "蒂尼·桑福德", "切斯特·康克林", "汉克·曼", "斯坦利·布莱斯通", "阿尔·欧内斯特·加西亚", "理查德·亚历山大", "塞西尔·雷诺兹", "米拉·麦金尼", "默多克·麦夸里", "威尔弗雷德·卢卡斯", "爱德华·勒桑", "弗雷德·马拉泰斯塔", "萨米·斯坦", "特德·奥利弗", "诺曼·安斯利", "博比·巴伯", "海尼·康克林", "格洛丽亚·德黑文", "帕特·弗莱厄蒂", "弗兰克·哈格尼", "帕特·哈蒙", "劳埃德·英格拉哈姆", "沃尔特·詹姆斯", "爱德华·金博尔", "杰克·洛", "巴迪·梅辛杰", "布鲁斯·米切尔", "弗兰克·莫兰", "詹姆斯·C·莫顿", "路易·纳托", "J·C·纽金特", "拉斯·鲍威尔", "约翰兰德", "哈里·威尔逊"], "is_watched": false}, {"rating": ["9.3", "50"], "rank": 9, "cover_url": "https://img1.doubanio.com/view/photo/s_ratio_poster/public/p2170238828.jpg", "is_playable": true, "id": "1293908", "types": ["喜剧", "剧情", "爱情"], "regions": ["美国"], "title": "城市之光", "url": "https://movie.douban.com/subject/1293908/", "release_date": "1931-01-30", "actor_count": 9, "vote_count": 104966, "score": "9.3", "actors": ["查理·卓别林", "弗吉尼亚·切瑞尔", "佛罗伦斯·李", "亨利·伯格曼", "珍·哈露", "哈利·迈耶斯", "约翰兰德", "罗伯特·帕里什", "罗伯特·格雷夫斯"], "is_watched": false}, {"rating": ["9.3", "50"], "rank": 10, "cover_url": "https://img2.doubanio.com/view/photo/s_ratio_poster/public/p2536540213.jpg", "is_playable": false, "id": "30312425", "types": ["喜剧"], "regions": ["美国"], "title": "丹尼尔·斯洛斯:现场表演", "url": "https://movie.douban.com/subject/30312425/", "release_date": "2018-09-11", "actor_count": 1, "vote_count": 3330, "score": "9.3", "actors": ["丹尼尔·斯洛斯"], "is_watched": false}, {"rating": ["9.3", "50"], "rank": 11, "cover_url": "https://img9.doubanio.com/view/photo/s_ratio_poster/public/p2184490255.jpg", "is_playable": false, "id": "6309377", "types": ["喜剧"], "regions": ["英国"], "title": "西蒙·阿姆斯特尔:顺其自然", "url": "https://movie.douban.com/subject/6309377/", "release_date": "2010", "actor_count": 1, "vote_count": 2832, "score": "9.3", "actors": ["西蒙·阿姆斯特尔"], "is_watched": false}, {"rating": ["9.3", "50"], "rank": 12, "cover_url": "https://img2.doubanio.com/view/photo/s_ratio_poster/public/p2215874393.jpg", "is_playable": true, "id": "26264388", "types": ["剧情", "喜剧", "音乐"], "regions": ["英国"], "title": "跳出我天地音乐剧", "url": "https://movie.douban.com/subject/26264388/", "release_date": "2014-09-28", "actor_count": 6, "vote_count": 1125, "score": "9.3", "actors": ["鲁茜·亨肖", "利亚姆·莫威尔", "霍华德·克罗斯利", "汤姆·赫兰德", "艾力厄特·翰纳", "伊莫珍·古尼"], "is_watched": false}, {"rating": ["9.2", "50"], "rank": 13, "cover_url": "https://img3.doubanio.com/view/photo/s_ratio_poster/public/p579729551.jpg", "is_playable": true, "id": "3793023", "types": ["剧情", "喜剧", "爱情", "歌舞"], "regions": ["印度"], "title": "三傻大闹宝莱坞", "url": "https://movie.douban.com/subject/3793023/", "release_date": "2011-12-08", "actor_count": 13, "vote_count": 1511678, "score": "9.2", "actors": ["阿米尔·汗", "卡琳娜·卡普尔", "马达范", "沙尔曼·乔希", "奥米·瓦依达", "博曼·伊拉尼", "莫娜·辛格", "拉杰夫·拉宾德拉纳特安", "Atul Tiwari", "阿里·法扎勒", "帕里卡沙特.萨赫尼", "Rakesh Sharma", "贾维德·杰弗里"], "is_watched": false}, {"rating": ["9.2", "45"], "rank": 14, "cover_url": "https://img1.doubanio.com/view/photo/s_ratio_poster/public/p2614500649.jpg", "is_playable": true, "id": "25662329", "types": ["喜剧", "动画", "冒险"], "regions": ["美国"], "title": "疯狂动物城", "url": "https://movie.douban.com/subject/25662329/", "release_date": "2016-03-04", "actor_count": 43, "vote_count": 1470808, "score": "9.2", "actors": ["金妮弗·古德温", "杰森·贝特曼", "伊德里斯·艾尔巴", "珍妮·斯蕾特", "内特·托伦斯", "邦尼·亨特", "唐·雷克", "汤米·钟", "J·K·西蒙斯", "奥克塔维亚·斯宾瑟", "艾伦·图代克", "夏奇拉", "雷蒙德·S·佩尔西", "德拉·萨巴", "莫里斯·拉马奇", "菲尔·约翰斯顿", "约翰·迪·马吉欧", "凯蒂·洛斯", "吉塔·雷迪", "杰西·科尔蒂", "汤米·利斯特", "乔希·达拉斯", "瑞奇·摩尔", "凯斯·索西", "彼得·曼斯布里奇", "拜伦·霍华德", "杰拉德·布什", "马克·史密斯", "乔西·特立尼达", "约翰·拉维尔", "克里斯汀·贝尔", "吉尔·科德斯", "梅利莎·古德温", "佟心竹", "季冠霖", "李楠", "Nan Li", "容祖儿", "黄子华", "蔡依林", "戴维德·迪格斯", "张震", "尼古拉斯·格斯特"], "is_watched": false}, {"rating": ["9.2", "45"], "rank": 15, "cover_url": "https://img9.doubanio.com/view/photo/s_ratio_poster/public/p2455050536.jpg", "is_playable": true, "id": "1292213", "types": ["喜剧", "爱情", "奇幻", "古装"], "regions": ["中国香港", "中国大陆"], "title": "大话西游之大圣娶亲", "url": "https://movie.douban.com/subject/1292213/", "release_date": "2014-10-24", "actor_count": 16, "vote_count": 1215539, "score": "9.2", "actors": ["周星驰", "吴孟达", "朱茵", "蔡少芬", "蓝洁瑛", "莫文蔚", "罗家英", "刘镇伟", "陆树铭", "李健仁", "金永钢", "胡立成", "付博文", "许敬义", "江约诚", "吴珏瑾"], "is_watched": false}, {"rating": ["9.2", "50"], "rank": 16, "cover_url": "https://img9.doubanio.com/view/photo/s_ratio_poster/public/p1454261925.jpg", "is_playable": false, "id": "6786002", "types": ["剧情", "喜剧"], "regions": ["法国"], "title": "触不可及", "url": "https://movie.douban.com/subject/6786002/", "release_date": "2011-11-02", "actor_count": 13, "vote_count": 789172, "score": "9.2", "actors": ["弗朗索瓦·克鲁塞", "奥玛·希", "安娜·勒尼", "奥德雷·弗勒罗", "托马·索利韦尔", "萨丽马特·卡马特", "皮埃尔-罗兰·巴纳隆", "多萝特博里埃", "克洛蒂尔德·莫勒", "海迪·布奇纳法", "艾米丽·卡恩", "阿尔芭·贝露吉", "让-弗朗索瓦·凯雷"], "is_watched": false}, {"rating": ["9.2", "45"], "rank": 17, "cover_url": "https://img3.doubanio.com/view/photo/s_ratio_poster/public/p1581774481.jpg", "is_playable": true, "id": "1298817", "types": ["喜剧", "爱情", "西部", "冒险"], "regions": ["美国"], "title": "淘金记", "url": "https://movie.douban.com/subject/1298817/", "release_date": "1925-06-26", "actor_count": 47, "vote_count": 41048, "score": "9.2", "actors": ["查理·卓别林", "马克·斯旺", "汤姆·默里", "亨利·伯格曼", "Malcolm Waite", "乔治亚·黑尔", "Jack Adams", "Sam Allen", "Harry Arras", "艾伯特·奥斯汀", "Marta Belfort", "George Brock", "海尼·康克林", "Kay Deslys", "James Dime", "Leon Farey", "Charles Force", "J.C. Fowler", "阿尔·欧内斯特·加西亚", "Inez Gomez", "希德·格鲁曼", "丽泰·格雷", "雷·格雷", "F.F. Guenste", "Jack Herrick", "George Holt", "Jean Huntley", "Gladys Johnston", "Fred Karno Jr.", "Elias Lazaroff", "Joan Lowell", "Chris-Pin Martin", "Clyde McAtee", "John Millerta", "贝蒂莫里西", "Florence Murth", "约翰兰德", "蒂尼·桑福德", "Frank Stockdale", "Frank Rice", "Lillian Rosine", "C.F. Roark", "Armand Triller", "John Wallace", "Tom Wood", "Ed Wilson", "Bess Wade"], "is_watched": false}, {"rating": ["9.2", "45"], "rank": 18, "cover_url": "https://img9.doubanio.com/view/photo/s_ratio_poster/public/p2506524685.jpg", "is_playable": true, "id": "1293270", "types": ["剧情", "喜剧", "家庭"], "regions": ["美国"], "title": "寻子遇仙记", "url": "https://movie.douban.com/subject/1293270/", "release_date": "1921-02-06", "actor_count": 26, "vote_count": 32969, "score": "9.2", "actors": ["查理·卓别林", "卡尔·米勒", "艾德娜·珀薇安丝", "杰基·库根", "艾伯特·奥斯汀", "Nellie Bly Baker", "亨利·伯格曼", "Edward Biby", "B.F. Blinn", "Kitty Bradbury", "弗兰克·坎皮沃", "Bliss Chevalier", "Robert Dunbar", "丽泰·格雷", "Jules Hanft", "Kathleen Kay", "Raymond Lee", "Clyde McAtee", "Lew Parker", "艾斯特·罗尔斯顿", "Granville Redmond", "查尔斯·赖斯纳", "Edgar Sherrod", "Arthur Thalasso", "S.D. Wilcox", "汤姆·威尔森"], "is_watched": false}, {"rating": ["9.2", "50"], "rank": 19, "cover_url": "https://img2.doubanio.com/view/photo/s_ratio_poster/public/p1339915772.jpg", "is_playable": true, "id": "1303418", "types": ["喜剧", "战争"], "regions": ["美国"], "title": "你逃我也逃", "url": "https://movie.douban.com/subject/1303418/", "release_date": "1942-03-06", "actor_count": 36, "vote_count": 28882, "score": "9.2", "actors": ["卡洛·朗白", "杰克·本尼", "罗伯特·斯塔克", "菲利克斯·布雷萨特", "莱昂内尔·阿特威尔", "Adolf E. Licho", "George Lynn", "奥拉夫·许滕", "约翰·凯洛格", "Hans Schumm", "Charles Irwin", "西戈·鲁曼", "拉斯·鲍威尔", "Wolfgang Zilzer", "Armand 'Curly' Wright", "Henry Victor", "罗兰德·瓦尔诺", "Ernö Verebes", "Otto Reichow", "Gene Rizzi", "哈利韦尔·霍布斯", "查尔斯·霍尔顿", "迈尔斯·曼德", "John Meredith", "Maurice Murphy", "赫尔穆特·丹丁", "斯坦利·里吉斯", "弗兰克·雷歇尔", "鲁道夫·安德斯", "莱兰·霍奇森", "Maude Eburne", "汤姆·杜根", "James Finlayson", "Leslie Denison", "Alec Craig", "Sven Hugo Borg"], "is_watched": false}, {"rating": ["9.2", "50"], "rank": 20, "cover_url": "https://img2.doubanio.com/view/photo/s_ratio_poster/public/p1959764913.jpg", "is_playable": true, "id": "1299628", "types": ["喜剧", "爱情"], "regions": ["美国"], "title": "马戏团", "url": "https://movie.douban.com/subject/1299628/", "release_date": "1928-01-06", "actor_count": 19, "vote_count": 14689, "score": "9.2", "actors": ["阿尔·欧内斯特·加西亚", "梅尔纳·肯尼迪", "哈里·克罗克", "George Davis", "亨利·伯格曼", "蒂尼·桑福德", "约翰兰德", "查理·卓别林", "艾伯特·奥斯汀", "斯坦利·布莱斯通", "海尼·康克林", "Toraichi Kono", "贝蒂莫里西", "L.J. O'Connor", "杰克 P. 皮尔斯", "Hugh Saxon", "Armand Triller", "吉恩·巴瑞", "乔治·W·戴维斯"], "is_watched": false}]
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值