From 6383a45d3a0d7536f80c3698a7d18f484cf82389 Mon Sep 17 00:00:00 2001 From: Evelyn Date: Wed, 7 Jun 2017 21:36:11 +0100 Subject: Take BS4 parser string from kwargs so you can actually XML. idk even what's the point --- Utils.py | 4 ++-- 1 file 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", ""): -- cgit v1.3.1-10-gc9f91