I'm trying to receive a notification when a booking website shows that there is a new appointment available in the near future (eg. through a cancellation). The site in question is booksy.com.
I have written a Puppeteer script which will navigate to the page and click a button which will then open a popup displaying text about when the next available appointment is. The script works for that.
My next step is to get the scrip to actually read the contents of the popup. Which has been an issue, as it is just trying to read the original page prior to the popup opening.
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
await page.goto('https://booksy.com/en-gb/45005_gents-of-richmond_barber_311817_london#ba_s=sgr_1');
await page.waitForSelector('button[data-testid="service-button"]');
const button = await page.$('button[data-testid="service-button"]');
await button.click();
})();
I think if I could read the page, I could extract the month and date displayed, and perhaps evaluate that output against the current date and determine if it is in a timeframe such as the next 7 days. Sending me a notification if it is within that period.
What I'm asking is simply how I can actually evaluate the contents popup, getting it's month and/or date as an output. Thanks!