英文:
IMDB API - Retrieve all movies from a list?
问题
Sure, here's the translation:
我想知道是否有一种方法可以通过API检索列表中的所有电影(例如:https://www.imdb.com/list/ls052535080/)?
我没有找到适用于这种用途的信息。
谢谢您的帮助!
英文:
I would like to know if there is a way to retrieve all the movies from a list (this one for example : https://www.imdb.com/list/ls052535080/) via an API ?
I see nothing for this kind of use.
Thanks for your help !
答案1
得分: 1
只需在列表URL末尾添加“export”一词,它将变为https://www.imdb.com/list/ls052535080/export
。
英文:
Just add export
word to the end of the list url, it'll be https://www.imdb.com/list/ls052535080/export
答案2
得分: 0
IMDB没有专门的API。这可能有所帮助(网页抓取)--
import requests
import browsercookie
import bs4
url = 'https://www.imdb.com/user/ur<user_id>/lists?ref_=nv_usr_lst_3'
cj = browsercookie.chrome()
res = requests.get(url, cookies=cj)
res.raise_for_status()
soup = bs4.BeautifulSoup(res.text, "html.parser")
英文:
IMDB does not have any API as such.
This could help (web scraping) --
import requests
import browsercookie
import bs4
url = 'https://www.imdb.com/user/ur<user_id>/lists?ref_=nv_usr_lst_3'
cj = browsercookie.chrome()
res = requests.get(url, cookies=cj)
res.raise_for_status()
soup = bs4.BeautifulSoup(res.text, "html.parser")
答案3
得分: 0
不需要使用API。所有列表都具有导出功能,该功能将以CSV文件的形式提供整个列表,其中包含各种字段:
- 职位、常数、创建时间、修改时间、描述、标题、URL、标题类型、IMDb评分、时长(分钟)、年份、类型、投票数、发布日期、导演、您的评分、评分日期
只需打开列表页面,即:/list/ls#########/, 然后点击页面右上角的垂直省略号菜单按钮:
然后点击弹出菜单中的“导出”链接:
您将会收到一个以列表名称为基础的CSV文件提示。
英文:
No API needed for this. All lists have an export function which will provide the entire list as a csv file containing a variety of fields:
- Position, Const, Created, Modified, Description, Title, URL, Title Type, IMDb Rating, Runtime (mins), Year, Genres, Num Votes, Release Date, Directors, Your Rating, Date Rated
Simply open up the list page ie: /list/ls#########/, click the vertical ellipsis menu button at the top right of the page:
Then click the "Export" link in the popup menu:
You'll be prompted with a csv file that has a filename based on the list name.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论