Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
This commit is contained in:
2018-02-28 10:39:06 -05:00
parent b640876d01
commit a1e979b012
2 changed files with 7 additions and 3 deletions
+6 -2
View File
@@ -11,7 +11,7 @@ from pyquery import PyQuery
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
@@ -101,6 +101,10 @@ class BaseParser:
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
@@ -113,7 +117,7 @@ class BaseParser:
"""`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:
+1 -1
View File
@@ -17,7 +17,7 @@ DESCRIPTION = 'HTML Parsing for Humans.'
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 = [