Найти - Пользователи
Полная версия: Переписать с pyqt4 на pyqt5
Начало » GUI » Переписать с pyqt4 на pyqt5
1
alexander4
Помогите переписать, уже несколько дней не получается
 import sys
from PyQt4 import QtCore, QtGui, QtWebKit
class Browser(QtWebKit.QWebView):
    def __init__(self, *arg, **args):
        QtWebKit.QWebView.__init__(self, *arg, **args)
        self.loadFinished.connect(self.load_complete)
    def load_complete(self):
        page = self.page().mainFrame().documentElement()
        if page.findFirst('.captcha input.big_text').tagName():
            print('Капча')
            return
        user = page.findFirst('#quick_email')
        passwd = page.findFirst('#quick_pass')
        submit = page.findFirst('#quick_login_button')
        user.evaluateJavaScript("this.value='123456'")
        passwd.evaluateJavaScript("this.value='123456'")
        submit.evaluateJavaScript("this.click()")
app = QtGui.QApplication(sys.argv)
b = Browser()
b.load(QtCore.QUrl('http://vk.com'))
b.show()
sys.exit(app.exec_())
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB