from lxml import etreeresponse = self.driver.page_sourcehtml = etree.HTML(response)
response = etree.tostring(html, encoding="utf-8").decode("utf-8")