diff options
| author | 2017-06-07 21:36:11 +0100 | |
|---|---|---|
| committer | 2017-06-07 21:36:11 +0100 | |
| commit | 6383a45d3a0d7536f80c3698a7d18f484cf82389 (patch) | |
| tree | 2aa7d925f465bd69a1162e4f0a75b129dc6cf88e | |
| parent | NR: 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.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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", ""): |
