qwebenginepage

How to save dynamically generated web page in QWebEngineView?

别说谁变了你拦得住时间么 提交于 2019-12-23 22:27:02
问题 I am loading a web page onto QWebEngineView . A user creates a different kind of tables (reports) and then needs to save those tables to local computer as a web page. Here is what I have tried: Here I use a QWebEnginePage::save() method, but nothing happens: connect(saveButton, &QPushButton::clicked, this, [this]() { engineWebView->page()->save("save.html"); }); Then I tried a QWebEngineProfile::download() method: connect(saveButton, &QPushButton::clicked, this, [this]() { engineWebView->page

How to detect button click inside Qwebengine in pyside2

我的未来我决定 提交于 2019-12-22 08:23:12
问题 I wrote an app in pyside2, which opening a webpage in QWebEngine. That web page has 2 buttons, I am not understanding how can I detect a button click in pyside2 app module, I need to perform other operation on that button click. Example below is my code from PySide2.QtWidgets import QApplication from PySide2.QtWebEngineWidgets import QWebEngineView, QWebEnginePage from PySide2.QtCore import QUrl class WebEnginePage(QWebEnginePage): def __init__(self, *args, **kwargs): QWebEnginePage.__init__

How to detect button click inside Qwebengine in pyside2

試著忘記壹切 提交于 2019-12-22 08:22:43
问题 I wrote an app in pyside2, which opening a webpage in QWebEngine. That web page has 2 buttons, I am not understanding how can I detect a button click in pyside2 app module, I need to perform other operation on that button click. Example below is my code from PySide2.QtWidgets import QApplication from PySide2.QtWebEngineWidgets import QWebEngineView, QWebEnginePage from PySide2.QtCore import QUrl class WebEnginePage(QWebEnginePage): def __init__(self, *args, **kwargs): QWebEnginePage.__init__

How to execute QWebEngine in Python function

╄→尐↘猪︶ㄣ 提交于 2019-11-30 21:39:58
问题 I have a QWebEngine class tor read webpages and create BeautifulSoup for them. Here is the code: import sys from bs4 import BeautifulSoup import os from PyQt5 import QtCore, QtWidgets, QtWebEngineWidgets class WebPage(QtWebEngineWidgets.QWebEnginePage): def __init__(self): super(WebPage, self).__init__() self.loadFinished.connect(self.handleLoadFinished) self.soup = [] def start(self, urls): self._urls = iter(urls) self.fetchNext() def fetchNext(self): try: url = next(self._urls) except