python - what's the difference between webView.load(QUrl) and QNetworkAccessManager.get(Qurl) in QT? -
update:i use javascriptconsolemessage , got message on there sites:
can't find variable: jquery
i use pyqt on project。 today want change web access way webview.load(qurl) qnetworkaccessmanager.get(qurl),because webview.load(qurl) can't use async.
just below:
before:
self.webview.load(qurl(input_url))
after:
am = qnetworkaccessmanager(parent=self) self.net_reply= am.get(net_requests) am.finished.connect(self.setweb) def setweb(self, netreply): replyarray = netreply.readall() self.qwebview.page().mainframe().setcontent(replyarray )
after changed,it work in websites, in websites(eg, http://www.china.com.cn) view not ,just dont have css style.how can change code right view webview.load(qurl)?
i suspect issue setcontent()
not being able load external resources (like css) because you're not using baseurl
parameter tell qwebview
make external requests from. can use qwebview::sethtml(...)
shortcut not set mime type in setcontent()
.
Comments
Post a Comment