mirror of
https://github.com/kennethreitz/requests-html.git
synced 2026-06-05 14:50:20 +00:00
Initialize PyQuery with lxml
PyQuery with XML sites also has the same issue that LXML does with unicode encoded strings because it uses LXML to parse the page. The fix has already been applied to LXML, so we can fix the issue with PyQuery by passing the already parsed LXML into PyQuery.
This commit is contained in:
+1
-1
@@ -146,7 +146,7 @@ class BaseParser:
|
||||
of the :class:`Element <Element>` or :class:`HTML <HTML>`.
|
||||
"""
|
||||
if self._pq is None:
|
||||
self._pq = PyQuery(self.html)
|
||||
self._pq = PyQuery(self.lxml)
|
||||
|
||||
return self._pq
|
||||
|
||||
|
||||
Reference in New Issue
Block a user