Skip to content

Commit

Permalink
Reset my careless changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
isudox committed Mar 1, 2018
1 parent 991a6cb commit 8fab96c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions requests_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ class HTML(BaseParser):

def __init__(self, *, url: str = DEFAULT_URL, html: _HTML, default_encoding: str = DEFAULT_ENCODING) -> None:

# Convert incoming unicode HTML into bytes.
if isinstance(html, str):
html = html.encode(DEFAULT_ENCODING)

super(HTML, self).__init__(
# Convert unicode HTML to bytes.
element=PyQuery(html)('html') or PyQuery('<html>{}</html>'.format(html))('html'),
Expand Down

0 comments on commit 8fab96c

Please sign in to comment.