Python3 uses pyqt5 to create an ultra-simple browser instance, python3pyqt5
We use the QWebview module, which also shows the usage of QWebview.
I used to find the content on the web page for half a day.
This is the core code:
webview = Qwebview()webview.load(Qurl('http://www.cnblogs.com/Blaxon/'))webview.show()
Complete Code (the code is changed by other code ):
from PyQt5.QtCore import *from PyQt5.QtWidgets import *from PyQt5.QtWebKitWidgets import *class Form(QWidget): def __init__(self, parent=None): super(Form, self).__init__(parent) tmp = QWebView() buttonLayout1 = QVBoxLayout() buttonLayout1.addWidget(tmp) mainLayout = QGridLayout() mainLayout.addLayout(buttonLayout1,) self.setLayout(mainLayout) self.setWindowTitle("Hello Qt") tmp.load(QUrl('http://www.cnblogs.com/misoag/archive/2013/01/09/2853515.html')) tmp.show()if __name__ == '__main__': import sys app = QApplication(sys.argv) screen = Form() screen.show() sys.exit(app.exec_())
The above example of using pyqt5 to create an ultra-simple browser in python3 is all the content that I have shared with you. I hope you can provide a reference and support for the customer's house.