From 1e3e5f951b7f41a50eed8d2f7e0089f0e2e7bb2d Mon Sep 17 00:00:00 2001 From: Oleksandr Kulkov Date: Fri, 6 May 2022 17:43:57 +0200 Subject: [PATCH] pass session to updated html Otherwise the session degrades from AsyncHTMLSession to HTMLSession. --- requests_html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests_html.py b/requests_html.py index 48e7fb2..ce7096c 100644 --- a/requests_html.py +++ b/requests_html.py @@ -700,7 +700,7 @@ async def arender(self, retries: int = 8, script: str = None, wait: float = 0.2, if not content: raise MaxRetries("Unable to render the page. Try increasing timeout") - html = HTML(url=self.url, html=content.encode(DEFAULT_ENCODING), default_encoding=DEFAULT_ENCODING) + html = HTML(url=self.url, session=self.session, html=content.encode(DEFAULT_ENCODING), default_encoding=DEFAULT_ENCODING) self.__dict__.update(html.__dict__) self.page = page return result