I would like to scrape a website hosting images.
Ultimately, the images are downloaded with a download button, which has an onclick method like this:
function downloadPhoto() {
data = { };
data.directory_id = '59125';
data.fileName = '_23113.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({ })
}
}
})
}
Sitemap:
{"_id":"metryki-genbaza","startUrl":["https://metryki.genbaza.pl/index/list"],"selectors":[{"id":"county","parentSelectors":["_root"],"type":"SelectorLink","selector":".nav-list a","multiple":true,"delay":0},{"id":"city","parentSelectors":["county"],"type":"SelectorLink","selector":".nav-list a","multiple":true,"delay":0},{"id":"docset","parentSelectors":["city"],"type":"SelectorLink","selector":".nav-list a","multiple":true,"delay":0},{"id":"doc","parentSelectors":["docset"],"type":"SelectorLink","selector":".span9 a","multiple":true,"delay":0},{"id":"download","parentSelectors":["doc"],"type":"SelectorPopupLink","selector":"button[onclick]","multiple":false,"delay":0},{"id":"county-name","parentSelectors":["doc"],"type":"SelectorText","selector":".breadcrumb li:nth-of-type(2) a","multiple":false,"delay":0,"regex":""},{"id":"city-name","parentSelectors":["doc"],"type":"SelectorText","selector":".breadcrumb li:nth-of-type(3) a","multiple":false,"delay":0,"regex":""},{"id":"docset-name","parentSelectors":["doc"],"type":"SelectorText","selector":".breadcrumb li:nth-of-type(4) a","multiple":false,"delay":0,"regex":""},{"id":"doc-num","parentSelectors":["doc"],"type":"SelectorText","selector":"ul.breadcrumb","multiple":false,"delay":0,"regex":""}]}
How can I scrape the image data?