-
When you post a Wikipedia link in a site or program that supports "previews", usually a small description will show up, as well as a relevant image (if any). I thought that the first eleent in Is there any way to do it that I'm not aware of? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
After looking a bit at the docs this morning I found a JSON Endpoint that would likely do what you are looking for. There are some portions of this project that attempts to parse the HTML page ( The following code could be used to simulate what I think you are asking: import requests
url = 'https://en.wikipedia.org/api/rest_v1/page/summary/Dog'
r = requests.get(url)
print(r.text) If this is what you are looking for, then perhaps this could be added. It isn't exactly the same API and something would need to be done to check if it is available (since this library supports more than just Wikipedia!) but it could be useful. Hope this helps! |
Beta Was this translation helpful? Give feedback.
After looking a bit at the docs this morning I found a JSON Endpoint that would likely do what you are looking for. There are some portions of this project that attempts to parse the HTML page (
logos
,hatnotes
, andparse_section_links
)The following code could be used to simulate what I think you are asking:
If this is what you are looking for, then perhaps this could be added. It isn't exactly the same API and something would need to be done to check if it is available (since this library supports more than just Wikipedia!) but it could be useful.
Hope this helps!