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:
Angus Dippenaar
2018-04-14 21:32:00 +02:00
committed by GitHub
parent c21f0784cd
commit 2a7d08722d
+1 -1
View File
@@ -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