Advertisement
Guest User

Untitled

a guest
Mar 16th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const puppeteer = require('puppeteer');
  2.  
  3. async function run() {
  4.     const browser = await puppeteer.launch();
  5.     const page = await browser.newPage();
  6.  
  7.     await page.goto('http://html5doctor.com/');
  8.     await page.focus('input[name="q"]');
  9.     await page.keyboard.down("Shift");
  10.     await page.keyboard.press("KeyA");
  11.     await page.keyboard.up("Shift");
  12.     await page.click('#search-button');
  13.     await page.screenshot({ path: 'htmldoctor12.png' });
  14.  
  15.     browser.close();
  16. }
  17.  
  18. run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement