PyQtWebEngine (Qt5)

5.15.18 · active · verified Thu Apr 16

PyQtWebEngine (Qt5) provides the Python bindings for Qt WebEngine, allowing the embedding of web content (based on Chromium) directly into PyQt5 applications. This package specifically targets applications built with PyQt5. It is maintained by Riverbank Computing and typically releases new versions in sync with PyQt5 and Qt5 patch releases.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to create a simple web browser view within a PyQt5 application, displaying Google's homepage.

import sys
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWebEngineWidgets import QWebEngineView
from PyQt5.QtCore import QUrl

def main():
    app = QApplication(sys.argv)

    browser = QWebEngineView()
    browser.setUrl(QUrl('https://www.google.com')) # For PyQtWebEngine 5.15.x, setUrl is still commonly used.
    browser.show()

    sys.exit(app.exec_())

if __name__ == '__main__':
    main()

view raw JSON →