Created
April 2, 2019 19:55
-
-
Save hamletbatista/37a04a3b97ca009656682548f9de9581 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| from pyppeteer import connect | |
| from time import sleep | |
| async def inspect_urls(urls): | |
| #example URI. Copy and paste from Chrome output | |
| #run Chrome using (Mac): | |
| #mkdir ~/chrome-dev | |
| #/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --no-first-run --user-data-dir=~/chrome-dev | |
| ws = "ws://127.0.0.1:9222/devtools/browser/52112a5a-7555-4743-a37f-5fb26bd81b92" | |
| browser = await connect({"browserWSEndpoint": ws}) | |
| page = await browser.newPage() | |
| #optional viewport resize | |
| await page.setViewport({"width": 1920, "height": 1280}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment