I found a very useful API in fast.ai.widgets.
Actully, I found it after I failed in downloading in Chrome using the method given in the Part1, lesson 2. Nevertheless, I finally solved the poblem using the code below:
var urls=Array.from(document.querySelectorAll('.rg_i')).map(el=> el.hasAttribute('data-src')?el.getAttribute('data-src'):el.getAttribute('data-iurl'));
var hiddenElement = document.createElement('a');
hiddenElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(urls.join('\n'));
hiddenElement.target = '_blank';
hiddenElement.download = 'myFile.csv';
hiddenElement.click();
This works well for me.
However, I think the download_google_image()
function may perform better. But something went wrong with my HTTPS connection.