Skip to content

Commit

Permalink
v0.3.0 screenshot support
Browse files Browse the repository at this point in the history
  • Loading branch information
iiSeymour committed May 13, 2017
1 parent f14b9a8 commit a015d0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions chromote/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
https://chromedevtools.github.io/devtools-protocol/1-2
"""

import base64

import json
from base64 import b64decode

import requests
import websocket
from requests.exceptions import ConnectionError

version = "0.2.0"

version = "0.3.0"
__version__ = version
__all__ = ['Chromote', 'ChromeTab']

Expand Down Expand Up @@ -94,7 +97,7 @@ def screenshot(self, format='png', quality=85, fromSurface=False):
data = json.loads(result)
if data.has_key('error'):
raise ValueError(data['error']['data'])
return base64.b64decode(data.get('result',{}).get('data', ''))
return b64decode(data.get('result', {}).get('data', ''))

def __str__(self):
return '%s - %s' % (self.title, self.url)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='chromote',
version='0.2.0',
version='0.3.0',
description="Python Wrapper for the Google Chrome Remote Debugging Protocol",
author='Chris Seymour',
packages=find_packages(),
Expand Down

0 comments on commit a015d0c

Please sign in to comment.