我已经定义了一个名为extract_movie(url)
现在,我有一个服务链接列表:movie_links = ['https://www.imdb.com/title/tt0111161', 'https://www.imdb.com/title/tt0068646', 'https://www.imdb.com/title/tt0071562']
如果我运行extract_movie(movie_links[0])
,则输出为['The Shawshank Redemption']
我的问题是如何获取['The Shawshank Redemption', 'The Godfather', 'The Godfather: Part II']
的列表
我尝试了以下代码,但不起作用
movie_name = []
for i in movie_links:
name = extract_movie(movie_links[0:2:1])
movie_name.append(name)