M
M
Maruto2020-02-27 00:06:04
Browsers
Maruto, 2020-02-27 00:06:04

How to download a file with links to all images on a page?

Good day. What is the problem. I need to get a data set for training a neural network. I plan to get it from Google Images. How: in Google Images itself I enter the desired query, a lot of pictures are opened on demand and I need to download a file with links to all these pictures (all, up to 700). I know it used to be done like this:
CtrlShiftJ on Windows/Linux and CmdOptJ on Mac. The console will open. Copy and paste the following code there:

urls = Array.from(document.querySelectorAll('.rg_di .rg_meta')).map(el=>JSON.parse(el.textContent).ou);
window.open('data:text/csv;charset=utf-8,' + escape(urls.join('\n')));

Now, with this execution, an empty file is downloaded. How to download the required file?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question