K
K
Kirill2020-08-19 15:54:02
C++ / C#
Kirill, 2020-08-19 15:54:02

How to save Base64 image by URL using Selenium C#?

Good afternoon.
There is a direct link to the photo.
How to save it using Selenium (or others) and convert it to Base64?

How do I download the file:

WebClient downloader = new WebClient();
downloader.DownloadFile(urlImgProduct, /*Путь*/);


But the very essence is to hold this file in the buffer, transfer it to Base and forget it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill, 2020-08-19
@BPL

using (WebClient downloader = new WebClient())
    {
        var base64 = Convert.ToBase64String(downloader.DownloadData(/*url*/));;
    }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question