daily pastebin goal
14%
SHARE
TWEET

Untitled

a guest Apr 17th, 2018 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import asyncio
  2. from pyppeteer import launch
  3.  
  4. loop = asyncio.get_event_loop()
  5.  
  6. browser = loop.run_until_complete(launch(**{
  7.             'executablePath': '/usr/bin/google-chrome-stable',
  8.             'ignoreHTTPSErrors': True,
  9.             'headless': False,
  10.             'args': ['--no-sandbox', '--proxy-server=proxy.crawlera.com:8010']
  11.         }))
  12.  
  13. page = loop.run_until_complete(browser.newPage())
  14. loop.run_until_complete(page.setExtraHTTPHeaders({'Proxy-Authorization': 'Basic XXXX'})) # replace XXX with base64 of "your_crawlera_login:" (colon at the end)
  15. # loop.run_until_complete(page.goto('http://httpbin.org/ip'))
  16. # loop.run_until_complete(page.goto('https://changerion.com/'))
  17. loop.run_until_complete(page.goto('https://www.google.com/search?q=sunterra+springs+independence&oq=sunterra+springs+independence&aqs=chrome..69i57j69i61.9616j0j1&sourceid=chrome&ie=UTF-8'))
  18. loop.run_until_complete(page.screenshot({'path': 'example.png'}))
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