Hi, friends!
You Can use the Wikipedia API for this work;
Look this Code:
import requests as rq
Query = "iran"#What Do You Want To Search In wikipedia
Lang = "en"#Your Language
Url = f"https://{Lang}.wikipedia.org/api/rest_v1/page/summary/{Query}"
Result = rq.get(Url).json()['extract']
print(str(Result))
Run and See The Result.
Do not forget to like!
Bye until the next post👋
Top comments (1)
Nice one
Actually you can use the Wikipedia module in python, it has a built in feature for summaries