Load more button with Puppeteer

I integrated following logic to click on the show-more button when there is one. But unfortunately It could not find the button... Also with page. waitforSelector(buttonSelector) it still does not work.
Why nothing happens while clicking the button?
An example for a product page you can find here (Click on SKUs): https://buildings.honeywell.com//us/en/products/by-category/access-control/control-panels/pro4200-controllers


export const handleProduct = async (page,url, crawler, dataset) => {
    page.waitForTimeout(4000);
    
    const buttonSelector = 'button#load_more_sku.secondary-cta.d-inline-block';
        while (true) {
            log.info('Waiting for the "Show more" button.');
            try {
                log.info('Clicking the "Show more" button.');
                await page.click(buttonSelector);
            } catch (err) {
                // Ignore the timeout error.
                log.info('Could not find the "Show more button", '
                    + 'we\'ve reached the end.');
                break;
            }
            
        }
Learn all about the Honeywell Security PRO4200 Controllers. Click to find product details, documentation, ordering info and more.
Was this page helpful?