Congratulations to our 2022 Qt Champions!

QWebPage chooseFile function override problem

  • Hi all,
    I am trying to upload a file programmatically to an input type file.
    My goal is to press the choose file button on a website and instead of seeing the dialog insert a file with software.
    I understand that I have to implement the function chooseFile myself or override it in a custom WebPage class.
    I am using python API, and I really dont know how to do that, please help !
    my browser application class looks like this:

    @class Browser(QApplication):
    def init(self):
    super(Browser, self).init(None)
    self.webView = QWebView()
    self.documentElement =

    def load(self, url):
    self.log.add("Loading page " + url)

    def upload(self):
    self.documentElement =

    does anyone know how to continue the upload method ?

Log in to reply