fix return
This commit is contained in:
parent
88be36d5cd
commit
9322159d2a
|
@ -1,5 +1,4 @@
|
||||||
import requests
|
import requests
|
||||||
from bs4 import BeautifulSoup
|
|
||||||
|
|
||||||
|
|
||||||
def get_auth_header(token_id, token_secret):
|
def get_auth_header(token_id, token_secret):
|
||||||
|
@ -12,9 +11,4 @@ def get_page_export_html(page_id, wiki_url, token_id, token_secret):
|
||||||
|
|
||||||
r = requests.get(wiki_url + "/api/pages/{}/export/html".format(page_id), headers=headers)
|
r = requests.get(wiki_url + "/api/pages/{}/export/html".format(page_id), headers=headers)
|
||||||
|
|
||||||
soup = BeautifulSoup(r.text, 'html.parser')
|
return r.text
|
||||||
elements = soup.find("code").text.strip().split("\n")
|
|
||||||
headers = elements.pop(0).split(",")
|
|
||||||
viewings = [dict(zip(headers, row.split(","))) for row in elements]
|
|
||||||
|
|
||||||
return viewings
|
|
||||||
|
|
Loading…
Reference in New Issue