In [1]:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys

In [2]:
driver = webdriver.Remote('http://192.168.59.103:4444/wd/hub', webdriver.DesiredCapabilities.CHROME)

In [3]:
driver.get("http://www.python.org")

In [4]:
driver.page_source[:500]


Out[4]:
u'<!DOCTYPE html><!--[if lt IE 7]>   <html class="no-js ie6 lt-ie7 lt-ie8 lt-ie9">   <![endif]--><!--[if IE 7]>      <html class="no-js ie7 lt-ie8 lt-ie9">          <![endif]--><!--[if IE 8]>      <html class="no-js ie8 lt-ie9">                 <![endif]--><!--[if gt IE 8]><!--><html xmlns="http://www.w3.org/1999/xhtml" class="js no-touch geolocation fontface generatedcontent svg formvalidation placeholder boxsizing no-retina flexslide" lang="en" dir="ltr"><!--<![endif]--><head>\n    <meta charset='

In [5]:
image = driver.get_screenshot_as_base64()

In [7]:
from IPython.display import HTML
HTML("""<img src="data:image/png;base64,{0}">""".format(image))


Out[7]:

In [ ]: