This commit is contained in:
deathbybandaid 2022-05-06 14:01:24 -04:00
parent fb68567ba0
commit aae8db0bbd

View File

@ -20,7 +20,7 @@ def fetch_string():
content_url = 'http://developerexcuses.com' content_url = 'http://developerexcuses.com'
response = requests.get(content_url) response = requests.get(content_url)
tree = html.fromstring(response.content) 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')
fetched_str = str(title_elem) fetched_str = str(title_elem)
return fetched_str return fetched_str
# .wrapper > center:nth-child(1) > a:nth-child(1) # .wrapper > center:nth-child(1) > a:nth-child(1)