Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

run node script pupeeter when button from form clicked

(async () => {
  const browser = await puppeteer.launch({ headless: true })
  const page = await browser.newPage()
  await page.setViewport({ width: 1280, height: 800 })
  await page.goto('https://www.staples.com/Painting-Supplies/cat_CL140420/bww15', { waitUntil: 'networkidle2' })
  await page.click('button.add-to-cart-btn.addToCart')
  await page.waitForSelector('h4.cart-items-header')
  await page.screenshot({ path: screenshot })
  await browser.close()
  console.log('See screen shot: ' + screenshot)
 })()
Comment

run node script pupeeter when button from form clicked

(async () => {
 const browser = await puppeteer.launch({ headless: true })
 const page = await browser.newPage()
 await page.goto('https://github.com/login')
 await page.type('#login_field', process.env.GITHUB_USER)
 await page.type('#password', process.env.GITHUB_PWD)
 await page.click('[name="commit"]')
 await page.waitForNavigation()
 await page.screenshot({ path: screenshot })
 browser.close()
 console.log('See screenshot: ' + screenshot)
})()
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript unshift 
Javascript :: === javascript 
Javascript :: find method javascript 
Javascript :: ckeditor inline editor example 
Javascript :: sum array without loop javascript 
Javascript :: deno vs nodejs 
Javascript :: NodeJS 10.24.1 
Javascript :: compare date javascript 
Javascript :: jquery ajax send custom data after serialize 
Javascript :: js array 
Javascript :: look up asciii value javascript 
Javascript :: push javascript 
Javascript :: arithmetic operators in javascript 
Javascript :: change image automaticly 
Javascript :: jquery get native element 
Javascript :: sum of an array 
Javascript :: react navbar material ui 
Javascript :: js map 
Javascript :: js error handling 
Javascript :: infinite loop in javascript 
Javascript :: check if property exists javascript 
Javascript :: bcrypt mongoose schema 
Javascript :: Remove duplicates from arrays using reduce 
Javascript :: textcontent javascript 
Javascript :: sequelize inner join 
Javascript :: custom processing datatables 
Javascript :: jsx return greatest number between two numbers 
Javascript :: check if a string matches a regex javascript 
Javascript :: javascript zoom image onclick 
Javascript :: how to convert react component to image 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =