Intro
ichrome 




Chrome controller for Humans, base on Chrome Devtools Protocol(CDP) and python3.7+.

If you encounter any problems, please let me know through issues, some of them will be a good opinion for the enhancement of ichrome.
Why?
- In desperate need of a stable toolkit to communicate with Chrome browser (or other Blink-based browsers such as Chromium)
ichromeincludes fast http & websocket connections (based on aiohttp) within an asyncio environment
- Pyppeteer is awesome
- But I don't need so much, and the spelling of pyppeteer is confused
- Event-driven architecture(EDA) is not always smart.
- Selenium is slow
- Webdriver often comes with memory leak
- PhantomJS development is suspended
- No native coroutine(
asyncio) support
- Webdriver often comes with memory leak
- Playwright comes too late
- This may be a good choice for both
syncandasyncusage- The 1st author of
puppeteerjoined it.
- The 1st author of
- But its core code is based on Node.js, which is too hard to monkey-patch.
- This may be a good choice for both
Features
As we known,
Javascriptis the first-class citizen of the Browser world, so learn to use it withichromefrequently.
- A process daemon of Chrome instances
- auto-restart
- command-line usage
asyncenvironment compatible
- Connect to an existing Chrome
- Operations on Tabs under stable
websocket- Commonly used functions
Incognito Mode
ChromeEngineas the progress pool- support HTTP
apirouter with FastAPI
- support HTTP
Flattenmode withsessionId- Create only 1 WebSocket connection
- New in version 2.9.0
- EXPERIMENTAL
- Share the same
Websocketconnection and usesessionIdto distinguish requests
- After v3.0.1
AsyncTab._DEFAULT_FLATTEN = True
- The install script of chromium
TODO
- [x] Add auto_restart while crash.
- [x] Add some useful examples.
- [x] Coroutine support (for asyncio).
- [x] Standard test cases.
- [x] Stable Chrome Process Pool.
- [x] HTTP apis server console with FastAPI.
- [x] Complete the document.