View Selenium screenshots in Jupyter without saving files

When displaying a screenshot of Selenium with Jupyter, I think it is common to write driver.save_screenshot ('screenshot.png'), but if you are using Jupyter, you will want to display it as it is. I did not find it unexpectedly when I looked it up, so I will introduce it.

manner

from IPython.display import Image
Image(driver.get_screenshot_as_png())

Recommended Posts

View Selenium screenshots in Jupyter without saving files
Embed wav files in Jupyter
View graphs inline in Jupyter Notebook
Screenshots of Megalodon in selenium and Chrome.
Read CSV files uploaded to Flask without saving
Bash in Jupyter
Automatically save .py and .html files in Jupyter notebook.
How to download files from Selenium in Python in Chrome
How to upload files in Django generic class view