Spaces:
Runtime error
Runtime error
File size: 489 Bytes
3060e5b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import wikipediaapi
class WikiClient:
def __init__(self):
self.wiki = wikipediaapi.Wikipedia(
user_agent="WikiAgent/0.0 [email protected]",
language="en",
extract_format=wikipediaapi.ExtractFormat.WIKI,
)
def get_pages(self, query):
pages = self.wiki.page(query)
return pages
if __name__ == "__main__":
client = WikiClient()
pages = client.get_pages("Cricket World Cup")
print(pages.summary)
|