OHLQ-api/scrape/index.js

21 lines
565 B
JavaScript

import puppeteer from 'puppeteer';
(async () => {
const browser = await puppeteer.launch();
var url = 'https://www.ohlq.com/liquor/whiskey/american/bourbon/wl-weller-antique-wheated-kentucky-straight-bour?sku=9534b';
const page = await browser.newPage();
await page.setViewport({ width: 1920, height: 1080 });
await page.goto(url);
//click on the button with the aria live "polite"
await page.click('button[data-test="ageVerificationButton"]');
await page.screenshot({ path: 'google.png' });
await browser.close();
})();