擅长:python、mysql、java
<p>下面是我在Python 3中的操作方法:</p>
<pre><code>import imdb
ia = imdb.IMDb()
movie = ia.get_movie_parents_guide("1640718")
print(movie)
</code></pre>
<p>输出应为:</p>
<pre><code>{'titlesRefs': {}, 'data': {'certification': [' Canada:G', ' (Alberta/Quebec/Nova Scotia)', ' Canada:PG', ' (Manitoba/Ontario)', ' Mexico:A', ' Portugal:M/6', ' Singapore:PG13', ' South Korea:All', ' (2015)', ' Sweden:7', ' Switzerland:6', ' United States:PG'], 'mpaa': 'Rated PG for thematic elements including some violence and sensual images'}, 'namesRefs': {}}
</code></pre>
<p>或者您可以使用:</p>
<pre><code>movie = ia.get_movie("1640718", info='parents_guide')
print(movie['mpaa'])
</code></pre>
<p>输出:</p>
<pre><code>Rated PG for thematic elements including some violence and sensual images
</code></pre>
<p>注意:“1640718”是不带“tt”的IMDb标题的ID,例如:<a href="https://www.imdb.com/title/tt1640718" rel="nofollow noreferrer">https://www.imdb.com/title/tt1640718</a></p>