Home > Enterprise >  Custom Web Browser crashed, Python
Custom Web Browser crashed, Python

Time:05-21

So, I was building a python web browser with pyqt5, I followed programming hero's tutorial but when I change the link of my webpage, the app just crashes and I have this error: Code
Code here:

import sys
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtWebEngineWidgets import *
from PyQt5.QtCore import *

class Main(QMainWindow):
    def __init__(self) -> None:
        super(Main, self).__init__()
        self.showMaximized()
        self.browser = QWebEngineView()
        self.browser.setUrl(QUrl('https://google.com'))
        self.setCentralWidget(self.browser)
        self.navbar = QToolBar()
        self.addToolBar(self.navbar)
        self.btn_back = QAction('Back', self)
        self.btn_back.triggered.connect(self.browser.back)
        self.navbar.addAction(self.btn_back)
        self.btn_forward = QAction('Forward', self)
        self.btn_forward.triggered.connect(self.browser.forward)
        self.navbar.addAction(self.btn_forward)
        self.btn_reload = QAction('Reload', self)
        self.btn_reload.triggered.connect(self.browser.reload)
        self.navbar.addAction(self.btn_reload)
        self.home = QAction('           
  • Related