TypeError: string indices must be integers, not str (Rotten Tomatoes)

TypeError: string indices must be integers, not str (Rotten Tomatoes)

我在 Python 上使用 Rotten Tomatoes SDK,我试图获取我正在搜索的所有电影的列表,但是当我发出请求时,我只能显示一个结果(因为:movie[0]['title']),如何得到所有的电影结果?

这是我的代码:

from rottentomatoes import RT
RT_KEY = 'XXXXXXXXX'
rt = RT(RT_KEY)
movie = raw_input('Enter the movie name: ')
fl = rt.search(movie, page_limit= 5)
title = fl['title'] #In order to work properly and show one result I should use fl[0]['title']
print title

但是当我 运行 程序时,在 'title=' 行给我 "TypeError: string indices must be integers, not str" 错误。我怎样才能显示所有结果? (在字符串中)请帮忙

fl 似乎是一个电影口述列表,您想为 fl 中的每个口述获取 'title' 键。所以不是 title = fl['title'],而是尝试:

title = []
for movie in fl:
    title.append(movie['title'])