Advertisement
Guest User

Untitled

a guest
Apr 10th, 2020
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const puppeteer = require('puppeteer-extra')
  2. const StealthPlugin = require('puppeteer-extra-plugin-stealth')
  3. puppeteer.use(StealthPlugin())
  4.  
  5. const args = [
  6.   '--no-sandbox',
  7.   '--disable-setuid-sandbox',
  8.   '--disable-infobars',
  9.   '--window-position=0,0',
  10.   '--ignore-certifcate-errors',
  11.   '--ignore-certifcate-errors-spki-list',
  12.   '--user-agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.39 Safari/537.36"'
  13. ];
  14.  
  15. const options = {
  16.   args,
  17.   headless: false,
  18.   ignoreHTTPSErrors: true,
  19.   dumpio: true,
  20.   userDataDir: './tmp'
  21. };
  22.  
  23. puppeteer.launch(options).then(async browser => {
  24.   const page = await browser.newPage()
  25.   await page.setViewport({
  26.     width: 1920,
  27.     height: 1080,
  28.   });
  29.   await page.setExtraHTTPHeaders({
  30.     'Accept-Language': 'en'
  31.   });
  32.   await page.goto('https://www.twitch.tv/mickalow', { "waitUntil": "networkidle2" })
  33.  
  34.   //await browser.close();
  35. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement