I tried
await page.click("div:contains('text')")
but it doesn't work.
Is it not possible to do so? Would I somehow have to grab the wrapper/"parent" of the HTML first, then call a click on it?
first check your element in not empty then fire click trigger.
if (!$('#element').is(':empty'))
{
document.getElementById("myCheck").click();
}