mirror of
https://github.com/simon987/od-database.git
synced 2025-04-20 02:46:45 +00:00
Attempt to fix Unicode errors part two
This commit is contained in:
parent
c309aa25c8
commit
86144935e3
@ -113,7 +113,7 @@ class HttpDirectory(RemoteDirectory):
|
|||||||
for link in links:
|
for link in links:
|
||||||
result.append((link.text, link.get("href")))
|
result.append((link.text, link.get("href")))
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
tree = etree.HTML(body.decode("utf-8", errors="ignore"), parser=self.parser)
|
tree = etree.HTML(body.decode("utf-8", errors="ignore").encode("utf-8"), parser=self.parser)
|
||||||
links = []
|
links = []
|
||||||
try:
|
try:
|
||||||
links = tree.findall(".//a/[@href]")
|
links = tree.findall(".//a/[@href]")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user