This commit is contained in:
deathbybandaid 2022-05-06 14:00:49 -04:00
parent 57aa0cfa92
commit fb68567ba0

View File

@ -1,6 +1,6 @@
import requests import requests
import lxml from lxml import html
from sopel import plugin from sopel import plugin
@ -19,7 +19,7 @@ def upper(bot, trigger, comrun):
def fetch_string(): def fetch_string():
content_url = 'http://developerexcuses.com' content_url = 'http://developerexcuses.com'
response = requests.get(content_url) 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] title_elem = tree.xpath('/html/body/div[1]/center/a')[0]
fetched_str = str(title_elem) fetched_str = str(title_elem)
return fetched_str return fetched_str