class Client(QWebEnginePage): def __init__(self,url): global app self.app = QApplication(sys.argv) QWebEnginePage.__init__(self) self.html = "" self.loadFinished.connect(self.on_load_finished) self.load(QUrl(url)) self.app.exec_() def on_load_finished(self): self.html = self.toHtml(self.Callable) print("Load Finished") def Callable(self,data): self.html = data self.app.quit()
url = "https://www.highcharts.com/demo/line-basic" client_response = Client(url) print(client_response.html)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)