Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/n0tan3rd/simplechrome
Webrecorders DevTools Protocol Automation Library
https://github.com/n0tan3rd/simplechrome
browser-automation chrome-debugging-protocol chromium puppeteer
Last synced: about 1 month ago
JSON representation
Webrecorders DevTools Protocol Automation Library
- Host: GitHub
- URL: https://github.com/n0tan3rd/simplechrome
- Owner: N0taN3rd
- Created: 2018-06-15T20:08:50.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-10-18T18:35:01.000Z (about 2 years ago)
- Last Synced: 2024-04-14T11:53:49.199Z (7 months ago)
- Topics: browser-automation, chrome-debugging-protocol, chromium, puppeteer
- Language: Python
- Homepage:
- Size: 385 KB
- Stars: 16
- Watchers: 8
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simplechrome
An fork of [pypuppeteer](https://github.com/miyakogi/pyppeteer) used by Webrecorder for automation that has been modified to meet our needs.Notable Additions to the API / code base per our own use-case:
- Changes to allow control of latests revisions of both Chrome and Chromium
- Changes to facilitate using the [uvloop](https://github.com/MagicStack/uvloop) event loop
- Changes to input handling for `evaluateOnNewDocument`
- Tracking child frame life cyles individually
- Less strict application defaults
- Keeps to date with puppeteer## Installation
Simplechrome requires python 3.6+.
Install latest version from [github](https://github.com/webrecorder/simplechrome):
```
pip install -U git+https://github.com/webrecorder/simplechrome.git@master
```## Usage
> **Note**: When you run simplechrome first time (if you do not supply an `executablePath`), it will download a recent version of Chromium (~100MB).
**Example**: Go to a web page and take a screenshot.
```py
import asyncio
import uvloop
from simplechrome import launchasyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
async def main():
browser = await launch()
page = await browser.newPage()
await page.goto('http://example.com')
await page.screenshot({'path': 'example.png'})
await browser.close()
if __name__ == '__main__':
asyncio.get_event_loop().run_until_complete(main())
```