如何获取维基百科类别页面中所有电影的 IMDb 链接?
How to get IMDb links of all films in a category page on Wikipedia?
我想获取维基百科上某个类别页面中所有电影的 IMDb 链接,例如:https://en.wikipedia.org/wiki/Category:American_historical_films。我听说过 Wikidata Query Service 和 PetScan,但老实说,它们太复杂了,我现在无法学习。你能帮我如何使用这些工具请求 IMDb 链接吗?提前致谢。
这里是查询代码
SELECT ?item ?title ?imdb WHERE {
{
SELECT ?item ?title WHERE {
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:api "Generator".
bd:serviceParam wikibase:endpoint "en.wikipedia.org".
bd:serviceParam mwapi:generator "categorymembers".
bd:serviceParam mwapi:gcmtitle "category:American_historical_films";
mwapi:gcmprop "ids|title";
mwapi:gcmtype "page";
mwapi:gcmlimit "max".
?title wikibase:apiOutput mwapi:title .
?item wikibase:apiOutputItem mwapi:item.
}
}LIMIT 100
}
?item wdt:P345 ?imdb.
} LIMIT 100
我想获取维基百科上某个类别页面中所有电影的 IMDb 链接,例如:https://en.wikipedia.org/wiki/Category:American_historical_films。我听说过 Wikidata Query Service 和 PetScan,但老实说,它们太复杂了,我现在无法学习。你能帮我如何使用这些工具请求 IMDb 链接吗?提前致谢。
这里是查询代码
SELECT ?item ?title ?imdb WHERE {
{
SELECT ?item ?title WHERE {
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:api "Generator".
bd:serviceParam wikibase:endpoint "en.wikipedia.org".
bd:serviceParam mwapi:generator "categorymembers".
bd:serviceParam mwapi:gcmtitle "category:American_historical_films";
mwapi:gcmprop "ids|title";
mwapi:gcmtype "page";
mwapi:gcmlimit "max".
?title wikibase:apiOutput mwapi:title .
?item wikibase:apiOutputItem mwapi:item.
}
}LIMIT 100
}
?item wdt:P345 ?imdb.
} LIMIT 100