SHARE
TWEET

goa

a guest Feb 27th, 2020 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const puppeteer = require('puppeteer');
  2.  
  3. async function goa(){
  4.  
  5.         const browser = await puppeteer.launch();
  6.         const page = await browser.newPage();
  7.  
  8.         await page.goto('https://google.com');
  9.  
  10.         await page.type('input[name=q]', 'teste');
  11.         await page.click('#tsf > div:nth-child(2) > div.A8SBwf > div.FPdoLc.tfB0Bf > center > input.gNO89b');
  12.  
  13.         await page.waitFor(1000);
  14.  
  15.         await page.screenshot({ path: 'goa.png' });
  16.  
  17.         await page.close();
  18.         await browser.close();
  19. };
  20.  
  21. async function run () {
  22.  
  23.         goa();
  24.  
  25. }
  26.  
  27. run().catch(console.error.bind(console));
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top