# -*- coding: utf-8 -*-
#######################
# WARNING
# Running this code sample will cost you Browshot credits
#######################

from browshot import BrowshotClient
import time

browshot = BrowshotClient('my_api_key')

# You must request HTML when creating the screenshot
screenshot = browshot.screenshot_create('http://mobilio.net/', { 'instance_id': 24, 'screen_width': 1280, 'screen_height': 1024, 'html': 1 })
time.sleep(60)

screenshot = browshot.screenshot_info(screenshot['id'])
if screenshot['status'] == 'finished':
  html = browshot.screenshot_html(screenshot['id'])
  if len(html) > 0:
    print "HTML is available"
#    print html