Trying to automate the process of clicking button on website page, but it only focuses on button not clicking on it.
I have tried using puppeteer click() fucntion and focus + press enter funtion none of them working
const puppeteer = require('puppeteer');
async function run() {
const browser = await puppeteer.launch({headless:true});
const page = await browser.newPage();
const BUTTON_SELECTOR = 'body > section > section > header > div.reply-button-row > button';
await page.goto('https://bozeman.craigslist.org/zip/d/bozeman-panasonic-36-tv/6837588995.html')
await page.waitFor(2000);
await page.waitFor(BUTTON_SELECTOR);
await page.click(BUTTON_SELECTOR)
//await page.focus(BUTTON_SELECTOR)
//await page.keyboard.press('Enter');
await page.screenshot({ path: 'screenshots/image.png' });
browser.close();
}
run();
Code output image : https://imgur.com/m0CYqNiqwe
Expected Output Image : https://imgur.com/Hmg3BgVasd