Saving to Python Selenium Screenshot Variables

Asked 2 years ago, Updated 2 years ago, 45 views

How do I save it to a variable without saving it as a screenshot file?

I'd like to access the website, take a screenshot, save it as a variable, not save it as a file, and register it as an attachment in an email and send it to you I'm asking you this question because I can only see you saving it as a file in Selenium.

If I save it as a file, I have to make a code that keeps erasing or erasing it

python selenium

2022-09-20 15:14

1 Answers

The method for saving screenshots to variables is extracted from WebDriver API.

get_screenshot_as_png()

    Gets the screenshot of the current window as a binary data.
    Usage:  driver.get_screenshot_as_png()


2022-09-20 15:14

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.