code: def screenshot(self, filename):
          
          if not filename.lower().endswith('.png'):
              warnings.warn("name used for saved screenshot does not match file "
                            "type. It should end with a `.png` extension", UserWarning)
          png = self.screenshot_as_png
          try:
              with open(filename, 'wb') as f:
                  f.write(png)
          except IOError:
              return False
          finally:
              del png
          return True
docs: Saves a screenshot of the current element to a PNG image file. Returns
             False if there is any IOError, else returns True. Use full paths in
             your filename.
  
          :Args:
           - filename: The full path you wish to save your screenshot to. This
             should end with a `.png` extension.
  
          :Usage:
              ::
  
                  element.screenshot('/Screenshots/foo.png')