开发者

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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜