-
The examples for download (examples/download.js) show the usage of download INSIDE a el.map. How do you use it outside a el.map?
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You should be able to call the download anywhere in the extraction function. export default function({ doc, absoluteURL }) {
const name = doc.find('h1');
const thumb = doc.find('img');
const thumburl = absoluteURL(thumb.attr('src'));
download(thumburl)
return {
name: name.text(),
thumb: thumb.attr('src')
}
} |
Beta Was this translation helpful? Give feedback.
-
After a bit of fiddling, I got it to work. So, if I'm understanding it correct, in order to download you need 3 things:
Challenge no. 1: directory OR filename.extension I can, however, use concat to use a dir and name for each file: It works for now. Challenge no. 2: get the path in the final JSON |
Beta Was this translation helpful? Give feedback.
You should be able to call the download anywhere in the extraction function.