Skip to content

Instantly share code, notes, and snippets.

@Visgean
Created November 22, 2017 02:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Visgean/11f6e14a31a8753bbc0d6d487e39cafc to your computer and use it in GitHub Desktop.
Save Visgean/11f6e14a31a8753bbc0d6d487e39cafc to your computer and use it in GitHub Desktop.
selenium screenshot
try:
self.wait.until(EC.presence_of_element_located(
(By.TAG_NAME, 'iframe')
))
except ElementNotVisibleException as e:
import base64
with open("/home/visgean/imageToSave.png", "wb") as fh:
fh.write(base64.b64decode(e.screen.encode()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment