如何获取所有维基百科文章标题? [英] How to get all Wikipedia article titles?
问题描述
如何在一个地方获取所有维基百科文章标题,而无需额外的字符和 pageid.只是文章的标题.像这样:
How to get all Wikipedia article titles in one place without extra characters and pageids. Just the article's title. Something like this:
当我下载维基百科转储时,我得到this
When I download wikipedia dump, I get this
也许我知道一种可以让我获得所有页面的运动,但我想一次获得所有页面.
Maybe I know a movement that might get me all pages but I wanted to get all pages in one take.
推荐答案
您可以在 https://dumps 上找到它.wikimedia.org
英语维基百科作为数据库转储的最新主命名空间中的页面标题列表是此处 (69 MB).
The latest List of page titles in main namespace for English Wikipedia as a database dump is here (69 MB).
如果您希望通过 API 获得它,您可以使用 query
和 list=allpages
但一次最多只能提供 500 个(机器人为 5k),因此您必须为英文维基百科进行 10 000 多次 API 调用.
If you rather want it through the API you use query
and list=allpages
but that only give you maximum 500 (5k for bots) at a time, so you will have to make more than 10 000 API calls for the English Wikipedia.
示例: https://en.wikipedia.org/w/api.php?action=query&format=xml&list=allpages&aplimit=max
这篇关于如何获取所有维基百科文章标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!