Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

puppeteer evaluate pass variable

const links = await page.evaluate((evalVar) => {

  console.log(evalVar); // 2. should be defined now
  …

}, evalVar); // 1. pass variable as an argument
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #puppeteer #evaluate #pass #variable
ADD COMMENT
Topic
Name
4+4 =