如何获得的&QUOT的结果;用preFIX&QUOT所有页面;维基百科使用API? [英] How to get the result of "all pages with prefix" using Wikipedia api?
问题描述
我想使用维基百科的API提取该页面的结果是:
I wish to use Wikipedia api to extract the result of this page:
http://en.wikipedia.org/wiki/Special:$p$ pfixIndex
在搜索就可以了东西,比如这个:
When searching "something" on it, for example this:
<一个href=\"http://en.wikipedia.org/w/index.php?title=Special%3A$p$pfixIndex&$p$pfix=tal&namespace=4\" rel=\"nofollow\">http://en.wikipedia.org/w/index.php?title=Special%3A$p$pfixIndex&$p$pfix=tal&namespace=4
然后,我想访问每个结果页面并提取他们的信息。
Then, I would like to access each of the resulting pages and extract their information.
什么API调用,我可能会使用?
What api call might I use?
推荐答案
您可以使用列表=所有页
并指定 AP preFIX
。例如:
You can use list=allpages
and specify apprefix
. For example:
<一个href=\"http://en.wikipedia.org/w/api.php?format=xml&action=query&list=allpages&ap$p$pfix=tal&aplimit=max\" rel=\"nofollow\">http://en.wikipedia.org/w/api.php?format=xml&action=query&list=allpages&ap$p$pfix=tal&aplimit=max
此查询会给你每个以 TAL
文章开头的ID和标题。如果你想获得关于每个页的详细信息,您可以使用此列表为发生器一>:
This query will give you the id and title of each article that starts with tal
. If you want to get more information about each page, you can use this list as a generator:
<一个href=\"http://en.wikipedia.org/w/api.php?format=xml&action=query&generator=allpages&gap$p$pfix=tal&gaplimit=max&prop=info\" rel=\"nofollow\">http://en.wikipedia.org/w/api.php?format=xml&action=query&generator=allpages&gap$p$pfix=tal&gaplimit=max&prop=info
您可以在托
参数给出不同的值,以获取有关该页面的不同信息。
You can give different values to the prop
parameter to get different information about the page.
这篇关于如何获得的&QUOT的结果;用preFIX&QUOT所有页面;维基百科使用API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!