H
H
Haker_Man2020-11-02 02:56:33
PyQt
Haker_Man, 2020-11-02 02:56:33

How to display recaptcha in pyqt?

how to display recaptcha in pyqt5? I saw this in auto-reg, but I do not know how to do it.
like this:
5f9f4b9a24c4b298864481.gif

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor T2, 2020-11-02
@Viktor_T2

import sys
from PyQt5 import QtCore, QtGui
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWebEngineWidgets import *

class WebPage( QWebEnginePage):
    def userAgentForUrl(self, url):
        return super(WebPage, self).userAgentForUrl(url) + ' Chrome'

class Window( QWebEngineView):
    def __init__(self):
        super(Window, self).__init__()
        self.setPage(WebPage(self))
        self.load(QtCore.QUrl('https://www.google.com/recaptcha/api2/demo'))

if __name__ == '__main__':

    app = QApplication(sys.argv)
    window = Window()
    window.setGeometry(300, 100, 600, 600)
    window.show()
    sys.exit(app.exec_())

This is a working example. The point
5f9f6e4050385149978331.png
is that we insert a QtWebEngine cutie browser window (actually chromium) into the cutie window
and call the web page with recaptcha

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question