【问题标题】:movie imdb get the id of the actor电影 imdb 获取演员的 id
【发布时间】:2017-01-01 04:42:43
【问题描述】:

我有一个actor对象,它有名字和id,我可以取名字,但不能取id

请看

>>> actor
<Person id:0000199[http] name:_Pacino, Al_>
>>> actor["name"]
u'Al Pacino'
>>> actor["id"]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IMDbPY-5.0-py2.7-macosx-10.6-intel.egg/imdb/utils.py", line 1469, in __getitem__
    rawData = self.data[key]
KeyError: 'id'
>>> 

【问题讨论】:

    标签: python imdb imdbpy


    【解决方案1】:

    使用Person 对象的.personID 属性:

    actor.personID
    

    【讨论】:

    • 有效,谢谢,系统允许后接受
    • 如何通过给出电影名称来获取电影ID
    猜你喜欢
    • 2019-04-16
    • 2014-12-04
    • 1970-01-01
    • 2015-08-13
    • 2016-06-19
    • 1970-01-01
    • 2015-05-25
    • 1970-01-01
    • 2013-04-12
    相关资源
    最近更新 更多