{"id":13585725,"url":"https://github.com/ClericPy/ichrome","last_synced_at":"2025-04-07T10:31:33.729Z","repository":{"id":48162093,"uuid":"158593755","full_name":"ClericPy/ichrome","owner":"ClericPy","description":"Chrome controller for Humans, based on Chrome Devtools Protocol(CDP) and python3.7+.","archived":false,"fork":false,"pushed_at":"2023-11-09T16:18:08.000Z","size":1652,"stargazers_count":209,"open_issues_count":5,"forks_count":27,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-23T22:20:15.980Z","etag":null,"topics":["cdp","chrome","chrome-controller","chrome-daemon","chrome-devtools-protocol","chrome-process-daemon","daemon","headless","python","python3","python37","torequests","webdriver"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/ichrome/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ClericPy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-11-21T18:59:04.000Z","updated_at":"2024-04-19T14:23:37.000Z","dependencies_parsed_at":"2022-09-23T12:04:16.401Z","dependency_job_id":"93ba5477-f05a-4c69-83a4-d67f0ec91ba8","html_url":"https://github.com/ClericPy/ichrome","commit_stats":{"total_commits":416,"total_committers":5,"mean_commits":83.2,"dds":0.28125,"last_synced_commit":"09388772b2f53244171367a6670e150de2c89bcd"},"previous_names":[],"tags_count":62,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClericPy%2Fichrome","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClericPy%2Fichrome/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClericPy%2Fichrome/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClericPy%2Fichrome/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ClericPy","download_url":"https://codeload.github.com/ClericPy/ichrome/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247636430,"owners_count":20970930,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cdp","chrome","chrome-controller","chrome-daemon","chrome-devtools-protocol","chrome-process-daemon","daemon","headless","python","python3","python37","torequests","webdriver"],"created_at":"2024-08-01T15:05:06.627Z","updated_at":"2025-04-07T10:31:33.464Z","avatar_url":"https://github.com/ClericPy.png","language":"Python","readme":"[ichrome](https://github.com/ClericPy/ichrome) [![PyPI](https://img.shields.io/pypi/v/ichrome?style=plastic)](https://pypi.org/project/ichrome/)![PyPI - Wheel](https://img.shields.io/pypi/wheel/ichrome?style=plastic)![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ichrome?style=plastic)![PyPI - Downloads](https://img.shields.io/pypi/dm/ichrome?style=plastic)![PyPI - License](https://img.shields.io/pypi/l/ichrome?style=plastic)\n\n----------\n\n\u003e Chrome controller for Humans, base on [Chrome Devtools Protocol(CDP)](https://chromedevtools.github.io/devtools-protocol/) and python3.7+. [Read Docs](https://clericpy.github.io/ichrome/)\n\n![image](https://github.com/ClericPy/ichrome/raw/master/structure.png)\n\n\u003e If you encounter any problems, please let me know through [issues](https://github.com/ClericPy/ichrome/issues), some of them will be a good opinion for the enhancement of `ichrome`.\n\n\n# Install\n\n    pip install ichrome -U\n\n\u003e Uninstall \u0026 Clear the user data folder\n\n        $ python3 -m ichrome --clean\n        $ pip uninstall ichrome\n\n## Quick Start\n\n```python\nimport asyncio\nfrom ichrome import AsyncChromeDaemon\n\n\nasync def test():\n    async with AsyncChromeDaemon() as cd:\n        # create a new tab\n        async with cd.connect_tab(index=None) as tab:\n            await tab.goto('https://github.com/ClericPy/ichrome', timeout=5)\n            print(await tab.title)\n        # Privacy Mode, proxyServer arg maybe not work on Chrome, for `Target.createBrowserContext` is the EXPERIMENTAL feature(but chromium is ok).\n        # https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-createBrowserContext\n        async with cd.incognito_tab(proxyServer='http://127.0.0.1:8080') as tab:\n            await tab.goto('https://httpbin.org/ip', timeout=5)\n            print(await tab.html)\n\n\nasyncio.run(test())\n```\n\n### [Read Docs](https://clericpy.github.io/ichrome/)\n\n# Why?\n\n- In desperate need of a stable toolkit to communicate with Chrome browser (or other Blink-based browsers such as Chromium)\n  - `ichrome` includes fast http \u0026 websocket connections (based on aiohttp) within an **asyncio** environment\n- Pyppeteer is awesome\n  - But I don't need so much, and the spelling of pyppeteer is confused\n  - Event-driven architecture(EDA) is not always smart.\n- Selenium is slow\n  - Webdriver often comes with memory leak\n    - PhantomJS development is suspended\n  - No native coroutine(`asyncio`) support\n- Playwright comes too late\n  - This may be a good choice for both `sync` and `async` usage\n    - The 1st author of `puppeteer` joined it.\n  - But its core code is based on Node.js, which is too hard to monkey-patch.\n\n# Features\n\n\u003e As we known, **`Javascript` is the first-class citizen of the Browser world**, so learn to use it with `ichrome` frequently.\n\n- A process daemon of Chrome instances\n  - **auto-restart**\n  - command-line usage\n  - `async` environment compatible\n- Connect to an **existing** Chrome\n- Operations on Tabs under stable `websocket`\n  - Commonly used functions\n  - `Incognito Mode`\n- `ChromeEngine` as the progress pool\n  - support HTTP `api` router with [FastAPI](https://github.com/tiangolo/fastapi) (EXPERIMENTAL)\n    - launch the chrome pool with `python -m ichrome.web`\n      - `python -m ichrome.web --help` for usage\n- `Flatten` mode with `sessionId`\n  - Create only **1** WebSocket connection\n  - New in version 2.9.0\n    - [EXPERIMENTAL](https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-attachToTarget)\n    - Share the same `Websocket` connection and use `sessionId` to distinguish requests\n  - After v3.0.1\n    - `AsyncTab._DEFAULT_FLATTEN = True`\n- The install script of chromium\n- debug mode for sync usage with `ichrome.debugger` \u003e4.0.0 (EXPERIMENTAL)\n","funding_links":[],"categories":["Python","chrome"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FClericPy%2Fichrome","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FClericPy%2Fichrome","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FClericPy%2Fichrome/lists"}