title: python selenium screenshot captcha image
body: <p>i want to take screenshot and crop only the captcha image, im write this code : <a href="http://pastebin.com/Hqau6kRD" rel="nofollow">http://pastebin.com/Hqau6kRD</a> :</p>
  
  <pre><code>elem = driver.find_element_by_css_selector("#imagecpt")
  loc  = elem.location
  size = elem.size
  left  = loc['x']
  top   = loc['y']
  width = size['width']
  height = size['height']
  box = (int(left), int(top), int(left+width), int(top+height))
  screenshot = driver.get_screenshot_as_png()
  img = Image.open(StringIO.StringIO(screenshot))
  area = img.crop(box)
  area.save('screenshot.png', 'PNG')
  </code></pre>
  
  <p>the image saved is complete black, where im wrong ?</p>