Getting image from memory cache

620 views
Skip to first unread message

Archil Gogorishvili

unread,
Feb 2, 2018, 12:49:59 AM2/2/18
to Selenium Users

Hello


My task is to get some images which is dynamically loaded, decrypted on client side using javascript and placed in memory cache. Unfortunately I didn't find any documentation that will help me to get those pictures either from memory cache or browser.


dev-tools


I am using chromedriver and c# but can use other webdriver.

Thanks for help


David

unread,
Feb 2, 2018, 12:12:37 PM2/2/18
to Selenium Users
Are those images shown in the UI of the site/page you loaded up where the javascript has processed the image? That would be your best means of retrieval. I'm assuming if you tried to fetch the element attributes of one of those images, it would be some URL link or more likely could be a base64 data URI.

If it's a base64 data URI, you can yourself decode it from base64 text to binary data and then write that to file (as an image, matching the image file format extension specified in the URI) using your Selenium language of choice (Java, python, .NET, etc.) - you wouldn't be doing this in Selenium API of course, but rather the language itself, the only part Selenium comes into play here is to extract out the base 64 data URI.

You could also just save the base64 data URI text to file, but you can only render it as image with a tool that converts base64 to binary and can then visualize the binary content.

If it's not a URL nor base64 data URI text, then I can't help you. Perhaps you can share a snippet of what the image element looks like in HTML from that page?
Reply all
Reply to author
Forward
0 new messages