Recently I use PyQt4 to crawl some web pages. I want to set different size of the browser which is generated by QWebView().show()
. I tried to use the following code snippet to set the size:
self.qsize = QWebPage().viewportSize()
self.qsize.setHeight(3000)
self.qsize.setWidth(1000)
print self.qsize.height()
print self.qsize.width()
But the browser displayed is always the same size.
Please give me some tips on how to set the size of the browser displayed by QWebView. Thanks in advance.
I tested this, the window resizes itself after loadFinished is emitted: