diff --git a/spicebot_command_devexcuse/__init__.py b/spicebot_command_devexcuse/__init__.py index d236d1b..b327645 100644 --- a/spicebot_command_devexcuse/__init__.py +++ b/spicebot_command_devexcuse/__init__.py @@ -1,6 +1,6 @@ import requests -import lxml +from lxml import html from sopel import plugin @@ -19,7 +19,7 @@ def upper(bot, trigger, comrun): def fetch_string(): content_url = 'http://developerexcuses.com' response = requests.get(content_url) - tree = lxml.html.fromstring(response.text) + tree = html.fromstring(response.content) title_elem = tree.xpath('/html/body/div[1]/center/a')[0] fetched_str = str(title_elem) return fetched_str