I have a question how to download an image with selenium and save it to disk. the download itself I know how to do from a direct link src. I have a page that has an 'download image' button but I would like to use python to download it. The code responsible for downloading the image looks like this, it is not a direct reference with a url link to it.
function downloadPhoto() {
data = { };
data.directory_id = '56899';
data.fileName = 'k_000078.JPG';
$.ajax({
url: '/photo/request-link',
data: data,
type: 'post',
dataType: 'json',
async: false,
success: function (response) {
if (response.state == 'TRUE') {
window.open('/photo/download');
}
else {
$('div#alert').html(response.message);
$('div#alert').dialog({ })
}
}
})
}
Thank you in advance for your help