1
jameslan 2018-03-27 01:16:39 +08:00 via Android 1
结尾的逗号
|
2
holajamc 2018-03-27 09:39:55 +08:00 1
r = requests.get( u ),
r = requests.get( u ) |
3
thebabypiggy OP @holajamc 我爬豆瓣 250 电影,相关图片内容都下载完了,然后报出这样的错误:Traceback (most recent call last):
File "/Users/zzz/Documents/Untitled.py", line 96, in <module> main() File "/Users/zzz/Documents/Untitled.py", line 92, in main download_covers( movies ) File "/Users/zzz/Documents/Untitled.py", line 81, in download_covers r = requests.get( imge_url ) NameError: name 'imge_url' is not defined,相关代码是: def download_covers(movies): for m in movies: imag_url = m.cover_url r = requests.get( imge_url ) path = 'covers/' + m.name.split( '/' )[0] + '.jpg' with open( path, 'wb' ) as f: f.write( r.content ) def main(): urls = urls_from_douban() movies = movies_from_url( urls ) movie_log( movies ) download_covers( movies ) if __name__ == '__main__': main() 感谢! |
4
thebabypiggy OP @holajamc 不用了,我 imge 打错了
|