diff --git a/README.md b/README.md index 664e0a9..1d23f2e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,6 @@ # ohlq-web-scrapper +Test using [Puppeteer](https://pptr.dev) to scrape [ohlq](https://ohlq.com). + + + diff --git a/index.js b/index.js new file mode 100644 index 0000000..f72c8a9 --- /dev/null +++ b/index.js @@ -0,0 +1,17 @@ +const puppeteer = require('puppeteer'); + +(async () => { + const browser = await puppeteer.launch(); + const page = await browser.newPage(); + + await page.setViewport({width: 1080, height: 1024}); + + await page.goto('https://www.ohlq.com/search-results?query=weller&contenttype=Product'); + + const ageButton = await page.$("button[data-test='ageVerificationButton']"); + await ageButton.click(); + + await page.screenshot({path: 'screenshot.jpg'}); + + await browser.close(); +})();