Problem loading a specific website through Qt Webkit

折月煮酒 提交于 2019-12-01 13:13:55

问题


I am currently using the following PyQt code to create a simple browser:

import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *

app = QApplication(sys.argv)
web = QWebView()
web.load(QUrl("http://www.robeez.com"))
web.show()
sys.exit(app.exec_())

Websites like google.com or stackoverflow.com work fine but robeez.com doesn't. Does anyone with Webkit experience know what might be wrong? robeez.com works fine in a regular browser like Chrome or Firefox.


回答1:


try arora (a very simple wrapping on top of QtWebKit); if it works, its your code. if it doesn't, its the website.




回答2:


For some reason http://www.robeeez.com which I think redirects to rebeez.com DOES work. In some cases rebeez.com sends out a blank index.html page, dillo and wget also receive nothing as does the qt45 demo browser. So is it the browser or the way the site is set up??




回答3:


Try sending the Accept-Language header also, it then works for me.



来源:https://stackoverflow.com/questions/1111267/problem-loading-a-specific-website-through-qt-webkit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!