Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
  • Loading branch information
kennethreitz committed Feb 28, 2018
1 parent b640876 commit a1e979b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions requests_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from fake_useragent import UserAgent
from lxml import etree
from lxml.html import HtmlElement
from lxml.html.soupparser import fromstring
from lxml.html.soupparser import fromstring as soup_parse
from parse import search as parse_search
from parse import findall, Result
from w3lib.encoding import html_to_unicode
Expand Down Expand Up @@ -101,6 +101,10 @@ def encoding(self) -> _Encoding:

return self._encoding if self._encoding else self.default_encoding

@encoding.setter
def encoding(self, enc):
self._encoding = enc

@property
def pq(self) -> PyQuery:
"""`PyQuery <https://pythonhosted.org/pyquery/>`_ representation
Expand All @@ -113,7 +117,7 @@ def lxml(self) -> HtmlElement:
"""`lxml <http://lxml.de>`_ representation of the
:class:`Element <Element>` or :class:`HTML <HTML>`.
"""
return fromstring(self.html)
return soup_parse(self.html)

@property
def text(self) -> _Text:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
URL = 'https://github.com/kennethreitz/requests-html'
EMAIL = 'me@kennethreitz.org'
AUTHOR = 'Kenneth Reitz'
VERSION = '0.6.8'
VERSION = '0.6.9'

# What packages are required for this module to be executed?
REQUIRED = [
Expand Down

0 comments on commit a1e979b

Please sign in to comment.