1
0
Fork 0
mirror of https://github.com/Findus23/acronomy.git synced 2024-09-19 15:33:45 +02:00

allow / in Wikipedia titles

This commit is contained in:
Lukas Winkler 2020-08-04 13:32:20 +02:00
parent 8a8895a6e0
commit aaa3500a38
Signed by: lukas
GPG key ID: 54DE4D798D244853

View file

@ -1,5 +1,5 @@
from typing import Tuple, Optional
from urllib.parse import urlencode
from urllib.parse import quote
import requests
from bs4 import BeautifulSoup
@ -16,7 +16,7 @@ class WikipediaAPISummary:
urlbase = "https://en.wikipedia.org/api/rest_v1/page/summary/"
def __init__(self, title: str):
r = requests.get(self.urlbase + urlencode(title))
r = requests.get(self.urlbase + title.replace("/","%2F"))
try:
r.raise_for_status()
except requests.HTTPError: