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.webView.showMaximized()
    self.webView.loadFinished.connect(self.loadFinished)
    self.documentElement = self.webView.page().currentFrame().documentElement()

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

    def upload(self):
    self.webView.load(QUrl(someurl))
    self.documentElement = self.webView.page().currentFrame().documentElement()@

    does anyone know how to continue the upload method ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.