fix: fstring formatted with bytes

This commit is contained in:
Xiao Tan
2019-02-21 13:48:39 +08:00
parent 9038704a90
commit f23ccbfcb5
+2 -2
View File
@@ -416,9 +416,9 @@ class HTML(BaseParser):
if isinstance(html, str):
html = html.encode(DEFAULT_ENCODING)
pq = PyQuery(html)
super(HTML, self).__init__(
# Convert unicode HTML to bytes.
element=PyQuery(html)('html') or PyQuery(f'<html>{html}</html>')('html'),
element=pq('html') or pq.wrapAll('<html></html>')('html'),
html=html,
url=url,
default_encoding=default_encoding