Skip to content

Instantly share code, notes, and snippets.

@nikosvaggalis
Created November 23, 2017 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikosvaggalis/c3879e957625783af7aadd79ad475a67 to your computer and use it in GitHub Desktop.
Save nikosvaggalis/c3879e957625783af7aadd79ad475a67 to your computer and use it in GitHub Desktop.
Puppeteer - Scrape smadeseek.com 1 level deep
const puppeteer = require("puppeteer");
const url = "http://smadeseek.com/index.html";
const imgSelector = "#about > div > div.row > div img";
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto(url, { waitUntil: "load" });
const imgAll = await page.$$eval(imgSelector, images => {return images.map((image)=>image.src)});
console.log(imgAll);
await browser.close();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment