I am trying to parse data from website and I am getting an error. Here's my python code
import urllib.request
import re
url = "http://ihned.cz"
req = urllib.request.Request(url)
resp = urllib.request.urlopen(req)
respData = resp.read().decode('utf-8')
#print(respData) #html kód
authors = re.findall(r'data-author="(.*?)"', str(respData))
for author in authors:
print(authors)
And here's the error.
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe1 in position 368: invalid continuation byte
Can you please help me? Thank you.