From f750df107e5682b74221422ca4081be7a2d857af Mon Sep 17 00:00:00 2001 From: Tyler Perkins Date: Mon, 30 Jan 2023 20:58:54 -0500 Subject: [PATCH] Add base file --- README.md | 4 ++++ index.js | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 index.js 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(); +})();