diff --git a/webkit2png/webkit2png.py b/webkit2png/webkit2png.py index 3a78e3a..4ea43a0 100755 --- a/webkit2png/webkit2png.py +++ b/webkit2png/webkit2png.py @@ -257,9 +257,9 @@ def _load_page(self, res, width, height, timeout): url = res if self.encodedUrl: - qtUrl = QUrl.fromEncoded(res) + qtUrl = QUrl.fromEncoded(url) else: - qtUrl = QUrl(res) + qtUrl = QUrl(url) # Set the required cookies, if any self.cookieJar = CookieJar(self.cookies, qtUrl) @@ -267,7 +267,7 @@ def _load_page(self, res, width, height, timeout): # Load the page if type(res) == tuple: - self._page.mainFrame().setHtml(res[0], res[1]) # HTML, baseUrl + self._page.mainFrame().setHtml(res[0], qtUrl) # HTML, baseUrl else: self._page.mainFrame().load(qtUrl)