Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

78
Visualizações
Changing document.title through JavaScript anonymous function

I am still a bit new to JavaScript. I am trying to dynamically change the title of a page through javascript. However I am getting a result of undefined. I have tried multiple things and still no luck. What is the right way to pass a value to this anonymous function?

let email = "myemail@email.com"
await page.evaluate(  (email) => document.title = email );
console.log(await page.title());
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I never used playwright js, but reading this documentation page here, https://playwright.dev/docs/evaluating, it looks like you pass arguments for the anonymous function as the second, and next parameters, of the evaluation method:

let email = "myemail@email.com"
await page.evaluate( (email) => document.title = email, email );
console.log(await page.title());
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda