From 3b48e104e4439ddf79b3ab26db364d80aecdba47 Mon Sep 17 00:00:00 2001 From: Michael Gohl Date: Wed, 30 Nov 2016 10:51:53 +0100 Subject: [PATCH] Javascript Console --- splash/qwebpage.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/splash/qwebpage.py b/splash/qwebpage.py index 9e0d90125..5dc1abf77 100644 --- a/splash/qwebpage.py +++ b/splash/qwebpage.py @@ -48,6 +48,7 @@ class SplashQWebPage(QWebPage): navigation_locked = False resource_timeout = 0 response_body_enabled = False + console_log = list() def __init__(self, verbosity=0): super(QWebPage, self).__init__() @@ -105,6 +106,7 @@ def javaScriptConfirm(self, frame, msg): def javaScriptConsoleMessage(self, msg, line_number, source_id): if self.verbosity >= 2: log.msg("JsConsole(%s:%d): %s" % (source_id, line_number, msg), system='render') + self.console_log.append("JsConsole(%s:%d): %s" % (source_id, line_number, msg)); def userAgentForUrl(self, url): if self.custom_user_agent is None: