how can I catch the error of "no existing page" in python
I developpe a browser with python and pyqt4 but I don't know what I put in loaderror
try:
self.webView.load(QtCore.QUrl(self.lineEdit.text()))
except loade开发者_开发百科rreur:
self.webView.load(QtCore.QUrl('erreur.html'))
when the page doesn't exist thx
Try loading up your browser of choice, and see what they do when given a page that doesn't exist.
You likely want to mimic that behaviour (Generic 404 page).
精彩评论