1
I need to select a value within a <select>
, but I’m not succeeding... I once did that same function of selecting a value in a <select>
but this time I’m not getting to make that selection.
Follows the code:
await page.waitForSelector('#form-clientes\:contrato') //return is not a valid selector
await page.select('#form-clientes\:contrato', '0000000')
The field selector itself comes with this \:
, the ID is #form-control:contrato
I also tried using page.evaluate(() => {})
but it didn’t work.
The error returned is always this
Error é: Error: Evaluation failed: DOMException: Failed to execute 'querySelector' on 'Document': '#form-clientes:contrato' is not a valid selector.
at predicate (eval at waitForPredicatePageFunction (:2:21), <anonymous>:6:20)
at eval (eval at waitForPredicatePageFunction (:2:21), <anonymous>:25:7)
at pollMutation (__puppeteer_evaluation_script__:17:31)
at waitForPredicatePageFunction (__puppeteer_evaluation_script__:9:18)
Use two bars on the selector
'#form-clientes\\:contrato'
– Sorack