Skip to content
Advertisement

Why my PyQt5 Webview Code is not working?

This is my code. Why its not working? Where is my problem?

JavaScript

Advertisement

Answer

Your code has 2 problems:

  1. The QWebEngineView is not a child of the window so it will not be displayed. Change to self.widget = QWebEngineView(Form)

  2. QUrl("google.com") is not a valid url so you have 2 options, change to:

    • QUrl("https://google.com") OR
    • QUrl.fromUserInput("google.com")
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement