Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

puppeteer create folder

const fs = require('fs');

[...] 
const path = `results/screenshots/${projectname}/${date}`;

try {
     await page.screenshot({ path: `${path}/SiteAdded.png` });
} catch(err) {
     fs.mkdirSync(path);
     await page.screenshot({ path: `${path}/SiteAdded.png` });
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #puppeteer #create #folder
ADD COMMENT
Topic
Name
7+3 =