如何使用imdbpy检索故事情节段落?
到目前为止,我还没有弄清楚如何使用 imdbpy 从 imdb 检索简短的描述段落。
我可以通过这种方式检索一个非常(非常)长的图:
ia = IMDb()
movie = ia.search_movie("brazil")
movie = movie[0]
movie = ia.get_movie(movie.movieID)
plot = movie.get('plot', [''])[0]
plot = plot.split('::')[0]
最后一行删除了提交者用户名。
在 HTML 源代码中,我正在查找的块被标记为
。
有什么想法吗?
谢谢 !
So far, I haven't figured out how to retrieve the short description paragraph from imdb with imdbpy.
I can retrieve a very (very) long plot this way though :
ia = IMDb()
movie = ia.search_movie("brazil")
movie = movie[0]
movie = ia.get_movie(movie.movieID)
plot = movie.get('plot', [''])[0]
plot = plot.split('::')[0]
The last line removes the submitter username.
In the HTML source, the block I'm looking for is markedup as <p itemprop="description">
.
Any idea ?
Thanks !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此代码将获取电影可用信息类型的列表:
This code will get a list of the type of information available for a movie: