From f23ccbfcb5019a291045b5eb61054c695e107d9c Mon Sep 17 00:00:00 2001 From: Xiao Tan Date: Thu, 21 Feb 2019 13:48:39 +0800 Subject: [PATCH] fix: fstring formatted with bytes --- requests_html.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requests_html.py b/requests_html.py index eb27eba..a6c80e8 100644 --- a/requests_html.py +++ b/requests_html.py @@ -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'), + element=pq('html') or pq.wrapAll('')('html'), html=html, url=url, default_encoding=default_encoding