From 2a7d08722d9d28c23efac63e6191385f093aa38c Mon Sep 17 00:00:00 2001 From: Angus Dippenaar Date: Sat, 14 Apr 2018 21:32:00 +0200 Subject: [PATCH] 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. --- requests_html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests_html.py b/requests_html.py index 0c3a989..4c8a59f 100644 --- a/requests_html.py +++ b/requests_html.py @@ -146,7 +146,7 @@ class BaseParser: of the :class:`Element ` or :class:`HTML `. """ if self._pq is None: - self._pq = PyQuery(self.html) + self._pq = PyQuery(self.lxml) return self._pq