用于获取属于某个类别的文章的维基百科 API [英] Wikipedia API to get articles belonging to a category

查看:29
本文介绍了用于获取属于某个类别的文章的维基百科 API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获取属于特定类别(例如体育和政治)的多个页面.我想从页面中提取各种部分,例如摘要、标题等.是否有 API 可以做到这一点?如果没有,是否有按类别组织的维基百科转储?

I would like to get a number of pages belonging to a specific category, say sports and politics. I would like to extract various sections from the pages, such as abstract, title, etc. Is there an API to do that? If not, are there any Wikipedia dumps organized by categories?

谢谢

推荐答案

您正在寻找 类别成员 api.请注意,您只会直接获得该单个类别中的页面,没有子类别;并且没有交集运算符.

You're looking for the categorymembers api. Notice that you will only get pages directly in that single category, no subcategories; and there are no intersection operators.

您可能希望将该列表用作生成器并查询当前修订版.

You probably will want to use that list as a generator and query the current revision of each.

这篇关于用于获取属于某个类别的文章的维基百科 API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆