2013-03-26 97 views
0
class Browser(QWebView): 
    def __init__(self): 
     QWebView.__init__(self) 
     self.loadFinished.connect(self._result_available) 
     self.loadStarted.connect(self._load_started) 
     self.page().frameCreated.connect(self.onFrame) 
    # ...  

browser = Browser() 
browser.setHtml('<html>...</html>', baseUrl=QUrl('http://www.google.com/')) 

在那之後,我需要捕獲由QWebView加載的所有外部資源的內容。我需要獲取所有CSS/Javascript文件的內容。我怎樣才能做到這一點 ?相關問題:question 1question 2PyQt4的QWebView外部資源內容

我知道我需要以某種方式使用QNetworkAccessManager,但我沒有任何使用示例。

回答

0

我們需要定製QNetworkReply類和readyRead事件結果得到的結果。