Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import asyncio
- from pyppeteer import launch
- loop = asyncio.get_event_loop()
- browser = loop.run_until_complete(launch(**{
- 'executablePath': '/usr/bin/google-chrome-stable',
- 'ignoreHTTPSErrors': True,
- 'headless': False,
- 'args': ['--no-sandbox', '--proxy-server=proxy.crawlera.com:8010']
- }))
- page = loop.run_until_complete(browser.newPage())
- loop.run_until_complete(page.setExtraHTTPHeaders({'Proxy-Authorization': 'Basic XXXX'})) # replace XXX with base64 of "your_crawlera_login:" (colon at the end)
- # loop.run_until_complete(page.goto('http://httpbin.org/ip'))
- # loop.run_until_complete(page.goto('https://changerion.com/'))
- 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'))
- loop.run_until_complete(page.screenshot({'path': 'example.png'}))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement