I am writing a program to get an image out of a website with selenium library in python. The site needs authentication through cookies so I use selenium instead of requests or urllib.
I managed to get to the page of the photo link, and take a printscreen of it, but the quality of the photo isn't good enough so I want to actually download the file.
Edit
I found out that Internet Explorer saves the image in its temporary Internet files folder. Because I know the name of the picture, I could easily receive the pic from this location
END EDIT#@
With the execute_script I could get a responsetext of the image, a unicode string that should represent the binary data of the image.
When I try to save the file windows is opening the following error:"Windows Photo Viewer can't open this picture because the file appears to be damaged, corrupted, or is too large".
Does anyone know how I can get the file, or re-decode the unicode string to the image file?