How to clear data from Wikipedia by category?

I would like to use only the medical data from Wikipedia for analysis. I use python for cleaning. I used this library to search for a word in a query:

import wikipedia

import requests
import pprint
from bs4 import BeautifulSoup
wikipedia.set_lang("en")
query = raw_input()
WikiPage = wikipedia.page(title = query,auto_suggest = True)
cat = WikiPage.categories
for i in cat:
    print i

and get categories.

But my problem is that:

I want to give a category, for example: medical or medical terminology, and get all the articles of this type.

How can i do this?

+4
source share
1 answer

Edit: actual answer

API:Categorymembers, , " , ". (. ) , .

:

Help:Category, :

, , . , incategory: "CategoryName" .

"", . ,

    incategory:"Suspension bridges" OR incategory:"Bridges in New York City"

, ( ) , .

, , . .

, Special:CategoryTree. . , <form> , API.

+1

Source: https://habr.com/ru/post/1615225/


All Articles