From 1f3b849086103f81531e163ef55fb73f3f0bc0f3 Mon Sep 17 00:00:00 2001 From: Nwachukwu Chukwudi Date: Tue, 1 Mar 2016 12:24:16 +0100 Subject: [PATCH 1/2] UnicodeErrors Detected UnicodeErrors on some sites as a result of forcing the unicode url to string --- ghost/ghost.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/ghost.py b/ghost/ghost.py index 3266d4d..ae0b5d2 100755 --- a/ghost/ghost.py +++ b/ghost/ghost.py @@ -234,7 +234,7 @@ def __init__(self, exclude_regex=None, *args, **kwargs): super(NetworkAccessManager, self).__init__(*args, **kwargs) def createRequest(self, operation, request, data): - if self._regex and self._regex.findall(str(request.url().toString())): + if self._regex and self._regex.findall(request.url().toString().encode('utf-8')): return QNetworkAccessManager.createRequest( self, QNetworkAccessManager.GetOperation, QNetworkRequest(QUrl())) From db7292195ed014624bccd66989692674ce9d9f74 Mon Sep 17 00:00:00 2001 From: Nwachukwu Chukwudi Date: Wed, 30 Mar 2016 08:57:51 +0100 Subject: [PATCH 2/2] Evaluate has kwargs This will help one add a 'timeout' to evaluate so that it would work with the code in can_load_page --- ghost/ghost.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/ghost.py b/ghost/ghost.py index ae0b5d2..517c996 100755 --- a/ghost/ghost.py +++ b/ghost/ghost.py @@ -686,7 +686,7 @@ def clear_alert_message(self): self._alert = None @can_load_page - def evaluate(self, script): + def evaluate(self, script, **kwargs): """Evaluates script in page frame. :param script: The script to evaluate.