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:
parent
8a8895a6e0
commit
aaa3500a38
1 changed files with 2 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue