1

I want to download some files with QWebEngineProfile but the downloadRequested Signal is not getting called on a certain website. I tried to use linkedClicked but I didn´t find this signal. Here is a cutout of my code:

class MainWindow(QtWidgets.QMainWindow, Webview.Ui_MainWindow):
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        self.setupUi(self)
        self.webView.page().profile().downloadRequested.connect(self.download_requested)

    def download_requested(self, download):
        tmp_file = tmpPath + "/File"
        download.setPath(tmp_file)

        download.accept()
        download.finished.connect(self.download_finished)
        print(download.path())

    @staticmethod
    def download_finished():
        print("finished")

When I now run the code, it neither prints "finished" nor the Path to save the file.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
  • You say: *certain website*, so I presume that on other web pages it works, if so, then to analyze your problem it is necessary that you share the *certain website* – eyllanesc Jun 10 '20 at 14:19
  • Here is some html: https://pastebin.com/7RcP1nqG – FunProgramer Jun 10 '20 at 18:42
  • That html doesn't help since the links don't point to anything. Provide a workable example. – eyllanesc Jun 10 '20 at 18:45
  • I think you don´t need an useful link. I changed one link to an local txt file. When I opened the html in Google Chrome and clicked on the link it opened me the txt file, but when I opened the html in my application it neither showed the text file nor invoked the dowmloadRequested Signal – FunProgramer Jun 11 '20 at 12:45
  • I don't necessarily need a link, but if any html that allows me to reproduce the problem, the html that you have provided me has relative links that obviously do not exist – eyllanesc Jun 11 '20 at 13:01

0 Answers0