Python3 uses pyqt5 to create an ultra-simple browser, 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 ):
1 from PyQt5.QtCore import * 2 from PyQt5.QtWidgets import * 3 from PyQt5.QtWebKitWidgets import * 4 5 6 class Form(QWidget): 7 def __init__(self, parent=None): 8 super(Form, self).__init__(parent) 9 10 tmp = QWebView()11 12 buttonLayout1 = QVBoxLayout()13 buttonLayout1.addWidget(tmp)14 15 mainLayout = QGridLayout()16 mainLayout.addLayout(buttonLayout1,)17 18 self.setLayout(mainLayout)19 self.setWindowTitle("Hello Qt")20 tmp.load(QUrl('http://www.cnblogs.com/misoag/archive/2013/01/09/2853515.html'))21 tmp.show()22 23 24 if __name__ == '__main__':25 import sys26 app = QApplication(sys.argv)27 screen = Form()28 screen.show()29 sys.exit(app.exec_())