aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Evelyn2017-06-07 21:36:11 +0100
committerGravatar Evelyn2017-06-07 21:36:11 +0100
commit6383a45d3a0d7536f80c3698a7d18f484cf82389 (patch)
tree2aa7d925f465bd69a1162e4f0a75b129dc6cf88e
parentNR: Allow null scheduled times, add inferred power/class if available in both... (diff)
signature
Take BS4 parser string from kwargs so you can actually XML. idk even what's the point
-rw-r--r--Utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Utils.py b/Utils.py
index 5396856f..28c8b466 100644
--- a/Utils.py
+++ b/Utils.py
@@ -72,9 +72,9 @@ def get_url(url, **kwargs):
response_content = response.read()
encoding = response.info().get_content_charset()
if kwargs.get("soup"):
- return bs4.BeautifulSoup(response_content, "lxml")
+ return bs4.BeautifulSoup(response_content, kwargs.get("parser", "lxml"))
if not encoding:
- soup = bs4.BeautifulSoup(response_content, "lxml")
+ soup = bs4.BeautifulSoup(response_content, kwargs.get("parser", "lxml"))
metas = soup.find_all("meta")
for meta in metas:
if "charset=" in meta.get("content", ""):