Si trato de hacer clic en un elemento como este, aparece un error:
const handle = await page.$('.days-label.col-md-12.desktop div:nth-child(1)'); await handle.click();Sin embargo, si hago clic así, funciona:
await page.$eval('.days-label.col-md-12.desktop div:nth-child(1)', el => el.click());Intenté solucionarlo esperando el selector y la navegación, pero sigue siendo el mismo error:
await page.waitForSelector('.days-label.col-md-12.desktop div:nth-child(1)'); const handle = await page.$('.days-label.col-md-12.desktop div:nth-child(1)'); await Promise.all([ page.waitForNavigation(), handle.click(), ]);waitForSelector() devuelve <Promise<?ElementHandle>> :
const handle = await page.waitForSelector( '.days-label.col-md-12.desktop div:nth-child(1)' ) await Promise.all([ page.waitForNavigation(), handle.click(), ])