How to save an svg-element using selenium not locally?

Viewed 75

I have a python-selenium-bot that takes a screenshot of an image and saves it in an assets folder which my frontend flutter-app then accesses. However I think there is a better way to do this. Is it possible to not save the picture on the disk but rather in a variable or something like that so that I can send it via my rest api. This would be a lot cleaner and not so error prone. Is there any way to save a svg without taking a screenshot of it?

1 Answers

Update:

My solution now is calling driver.get_screenshot_as_bas64 this allows me to save the screenshot as base64 in a variable and then pass that through my API. My Frontend can then decoded that screenshot again.

Related