Errors with clicking on a checkbox with Puppeteer

Solution for Errors with clicking on a checkbox with Puppeteer
is Given Below:

I’ve been having issues clicking on a checkbox on Footlocker Au’s checkout page. I have tried to search it up online and have tried using selector and xpath but both does not work.

https://i.stack.imgur.com/uyXFe.png

This is what I have used, but I have tried the standard
await page.click(" ");

Site : https://www.footlocker.com.au/en/p/nike-tuned-men-shoes-47241?v=244209281104#!searchCategory=men

await page.evaluate(() => {
   document.querySelector("body > main > div > div.fl-checkout > form > div > div.fl-checkout--content-container--address-block > div.fl-checkout--content-container--address-block--options-field > div:nth-child(3) > div > div > label").click();
});

You could target the input directly and click that instead.
The selector could be simplified greatly using the id instead of this insanely long and probably inaccurate selector.

'#fl-input-checkbox-create-account-panel'

You could even target the label if you needed to:

'label[for="fl-input-checkbox-create-account-panel"]'

I had a similar issue a while back, I was intercepting unnecessary request (eg: stylesheets, fonts …etc) which was affecting the overall aspect of the page and messing up the await page.click(" "); capability. That’s because await page.click(" "); is mimicking human behavior. If it’s not clickable for a human, it’s not for puppeteer (in short).

To go around that instead I used:

page.$eval(`YourSelectorPath`, element => element.click());