Wikipedia-API icon indicating copy to clipboard operation
Wikipedia-API copied to clipboard

How get a page by URL?

Open yoeldk opened this issue 8 months ago • 1 comments

Is there a way to get a page by URL instead of title?

TIA! Yoel

yoeldk avatar May 03 '25 08:05 yoeldk

just use the split method?

import wikipediaapi
wiki_wiki = wikipediaapi.Wikipedia(user_agent='john ([email protected])',language='en')

url = "https://en.wikipedia.org/wiki/GitHub"
page = wiki_wiki.page(url.split("/")[-1])

if page.exists():
    print(page.title)
    print(page.summary)

kth8 avatar May 10 '25 07:05 kth8

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Jun 25 '25 03:06 github-actions[bot]

This issue was closed because it has been stalled for 10 days with no activity.

github-actions[bot] avatar Jul 06 '25 03:07 github-actions[bot]