Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafael Alfaro committed Oct 10, 2018
1 parent ec43ce1 commit 84e7376
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ async function getImages(url , index=0){
}

await page.goto(url, {waitUntil: 'networkidle2'});
const images_links = await page.$$eval('img', image => image.filter(image => image.naturalWidth == 0 || image.readyState == 'uninitialized').map(img => img.src));
if (images_links) {
let images_links = await page.$$eval('img', image => image.filter(image => image.naturalWidth == 0 || image.readyState == 'uninitialized').map(img => img.src));
if (images_links.length >= 1) {
await page.screenshot({path: `page-${index}.png`, fullPage: true });
images_links.forEach((image) => {
console.log(image);
Expand Down

0 comments on commit 84e7376

Please sign in to comment.