{"id":44411609,"url":"https://github.com/douglasdcm/caqui","last_synced_at":"2026-04-01T20:52:01.143Z","repository":{"id":167115853,"uuid":"642602592","full_name":"douglasdcm/caqui","owner":"douglasdcm","description":"Run synchronous and asynchronous commands in WebDrivers","archived":false,"fork":false,"pushed_at":"2026-03-21T03:11:08.000Z","size":28189,"stargazers_count":14,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-21T17:28:08.742Z","etag":null,"topics":["appium","asynchronous","crawler","python","scraper","synchronous","webdriver","winappdriver","winium"],"latest_commit_sha":null,"homepage":"","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/douglasdcm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"docs/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-05-19T00:19:28.000Z","updated_at":"2026-03-21T03:10:15.000Z","dependencies_parsed_at":"2023-11-09T02:40:27.576Z","dependency_job_id":"603bc0d0-7e99-4bc7-9231-57ce193ffa67","html_url":"https://github.com/douglasdcm/caqui","commit_stats":null,"previous_names":["douglasdcm/caqui"],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/douglasdcm/caqui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasdcm%2Fcaqui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasdcm%2Fcaqui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasdcm%2Fcaqui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasdcm%2Fcaqui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/douglasdcm","download_url":"https://codeload.github.com/douglasdcm/caqui/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasdcm%2Fcaqui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31291851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["appium","asynchronous","crawler","python","scraper","synchronous","webdriver","winappdriver","winium"],"created_at":"2026-02-12T07:40:31.221Z","updated_at":"2026-04-01T20:52:01.133Z","avatar_url":"https://github.com/douglasdcm.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Caqui\n\n[![Python application](https://github.com/douglasdcm/caqui/actions/workflows/python-app.yml/badge.svg)](https://github.com/douglasdcm/caqui/actions/workflows/python-app.yml)\n[![PyPI Downloads](https://static.pepy.tech/badge/caqui)](https://pepy.tech/projects/caqui)\n\n**Caqui** is a Python library for browser, mobile, and desktop automation that works with any driver that exposes a WebDriver-style REST API or Chrome Devtools Protocol. It lets you send commands **synchronously or asynchronously**, and you don’t need to think about which underlying driver you’re using.\n\nCaqui is designed for developers who want a unified automation API that can run:\n\n* Chrome Devtools Protocol ((Chrome, Opera, Edge))\n* WebDriver (Chrome, Firefox, Opera, Edge)\n* Appium (Android, iOS)\n* Winium / WinAppDriver (Windows desktop applications)\n* Any remote WebDriver-compatible server\n\nCaqui runs seamlessly on a local machine or across remote hosts, and supports both **multitasking with asyncio** and **multiprocessing** for high-throughput use cases such as parallel testing, web scraping, or distributed automation.\n\n---\n\n# Supported Web Drivers\n\n| WebDriver             | Version | Remote* | If remote                                                       |\n| --------------------- | ------- | ------- | ------------------------------------------------------------- |\n| Appium                | 2.0.0+  | Y       | Accepts remote calls by default. Tested with Appium in Docker |\n| Firefox (geckodriver) | 113+    | Y       | Requires defining the host IP, e.g. `--host 123.45.6.78`      |\n| Google Chrome         | 113+    | Y       | Requires allowed IPs, e.g. `--allowed-ips=123.45.6.78`        |\n| Opera                 | 99+     | Y       | Same restrictions as Chrome                                   |\n| WinAppDriver          | 1.2.1+  | Y       | Requires host IP, e.g. `WinApppage.exe 10.0.0.10 4723`        |\n| Winium Desktop        | 1.6.0+  | Y       | Accepts remote calls by default                               |\n\n*Remote = can accept REST requests when running as a server.\n\n---\n\n# Installation\n\n```bash\npip install caqui\n```\n\n---\n\n# Using Caqui 2.0.0+\n\nFrom version **2.0.0+**, Caqui includes a high-level API that mirrors Selenium’s object model and exposes async methods for browser, mobile, and desktop automation.\n[Full documentation:](https://caqui.readthedocs.io/en/latest/caqui.html)\n\nChrome Devtools Protocol example:\n```python\nimport time\nfrom pytest import raises, fixture\nfrom caqui.cdp.by import By\nfrom caqui.cdp.connection import SyncCDPConnection\nfrom caqui.cdp.synchronous.drivers import SyncDriverCDP\nfrom caqui.exceptions import WebDriverError\nfrom tests.constants import OTHER_URL\nfrom caqui.cdp.server import LocalServerCDP, get_ws_url\n\n@fixture(autouse=True, scope=\"session\")\ndef launch_browser():\n    server = LocalServerCDP()\n    server.start_chrome()\n    yield server\n    server.dispose()\n\n@fixture\ndef setup_sync_cdp_playground():\n    with SyncCDPConnection(get_ws_url()) as conn:\n        driver = SyncDriverCDP(conn)\n        driver.get(PAGE_URL)\n        driver.set_window_size(1000, 1000)\n        yield driver\n\nclass TestSyncCDPElement:\n    def test_cdp_is_element_enabled(self, setup_sync_cdp_playground: SyncDriverCDP):\n        driver = setup_sync_cdp_playground\n        locator_type = By.XPATH\n        locator_value = \"//input\"\n        element = driver.find_element(locator_type, locator_value)\n        assert element.is_enabled() is True\n```\n\nWeb Driver example:\n\n```python\nfrom os import getcwd\nfrom pytest import mark, fixture\nfrom caqui.webdriver.drivers import AsyncDriver\nfrom caqui.webdriver.capabilities import ChromeCapabilitiesBuilder\nfrom caqui.by import By\nfrom caqui.webdriver.server import LocalServer\n\nBASE_DIR = getcwd()\nPAGE_URL = f\"file:///{BASE_DIR}/html/playground.html\"\nSERVER_PORT = 9999\nSERVER_URL = f\"http://localhost:{SERVER_PORT}\"\n\n\n@fixture(autouse=True, scope=\"session\")\ndef setup_server():\n    server = LocalServer(port=SERVER_PORT)\n    server.start_chrome()\n    yield\n    server.dispose(delay=3)\n\n\n@fixture\ndef caqui_driver():\n    server_url = SERVER_URL\n    capabilities = (\n        ChromeCapabilitiesBuilder().accept_insecure_certs(True).args([\"headless\"])\n    )\n    page = AsyncDriver(server_url, capabilities)\n    yield page\n    page.quit()\n\n\n@mark.asyncio\nasync def test_switch_to_parent_frame_and_click_alert(caqui_driver: AsyncDriver):\n    await caqui_driver.get(PAGE_URL)\n    element_frame = await caqui_driver.find_element(By.ID, \"my-iframe\")\n    assert await caqui_driver.switch_to.frame(element_frame)\n\n    alert_button_frame = await caqui_driver.find_element(By.ID, \"alert-button-iframe\")\n    await alert_button_frame.click()\n    await caqui_driver.switch_to.alert.dismiss()\n\n    await caqui_driver.switch_to.default_content()\n    alert_button_parent = await caqui_driver.find_element(By.ID, \"alert-button\")\n    assert await alert_button_parent.get_attribute(\"any\") == \"any\"\n    await alert_button_parent.click()\n\n```\n\n---\n\n# Running Tests with Multitasking\n\nCaqui supports asyncio out of the box.\nTo run multiple async tests concurrently, use **pytest-async-cooperative**:\n\n```python\n@mark.asyncio_cooperative\nasync def test_save_screenshot(caqui_driver: AsyncDriver):\n    await caqui_driver.get(PAGE_URL)\n    assert await caqui_driver.save_screenshot(\"/tmp/test.png\")\n\n\n@mark.asyncio_cooperative\nasync def test_click(caqui_driver: AsyncDriver):\n    await caqui_driver.get(PAGE_URL)\n    element = await caqui_driver.find_element(By.XPATH, \"//button\")\n    await element.click()\n```\n\nRunning tests this way significantly reduces execution time, especially when interacting with multiple drivers or sessions.\n\n---\n\n# Running Tests with Multiprocessing\n\nIf your workloads benefit from multiple processes, Caqui also works with **pytest-xdist**.\nThis approach is often faster than cooperative multitasking.\n\nA guide to optimizing performance (including a real benchmark):\n[Speed up your web crawlers at 90%](https://medium.com/@douglas.dcm/speed-up-your-web-crawlers-at-90-148f3ca97b6)\n\nExample:\n\n```python\n@mark.asyncio\nasync def test_save_screenshot(caqui_driver: AsyncDriver):\n    await caqui_driver.get(PAGE_URL)\n    assert await caqui_driver.save_screenshot(\"/tmp/test.png\")\n\n\n@mark.asyncio\nasync def test_click(caqui_driver: AsyncDriver):\n    await caqui_driver.get(PAGE_URL)\n    element = await caqui_driver.find_element(By.XPATH, \"//button\")\n    await element.click()\n\n```\n\n---\n\n# Running a Driver as a Server\n\nIf you use external drivers such as Appium, Winium, or a standalone ChromeDriver, run them as servers and point Caqui to their URL.\n\nExample for ChromeDriver on port 9999:\n\n```bash\n$ ./chromedriver --port=9999\nStarting ChromeDriver 94.0.4606.61 (418b78f5838ed0b1c69bb4e51ea0252171854915-refs/branch-heads/4606@{#1204}) on port 9999\nOnly local connections are allowed.\nPlease see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.\nChromeDriver was started successfully.\n```\n\n---\n\n# WebDriver Manager\n\nCaqui’s `LocalServer` class uses [Webdriver Manager](https://pypi.org/project/webdriver-manager/).\nThe tool comes with its own constraints.\nCheck its documentation for details if you need custom driver handling.\n\n---\n\n# Contributing\n\nBefore submitting a pull request, review the project guidelines:\nCode of Conduct:\n[CODE OF CONDUCT](https://github.com/douglasdcm/caqui/blob/main/docs/CODE_OF_CONDUCT.md)\n\nContribution Guide:\n[CONTRIBUTING](https://github.com/douglasdcm/caqui/blob/main/docs/CONTRIBUTING.md)\n\nContributions, issue reports, and performance feedback are welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdouglasdcm%2Fcaqui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdouglasdcm%2Fcaqui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdouglasdcm%2Fcaqui/lists"}