pystealth


Namepystealth JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/DedInc/pystealth
SummaryPython module for preventing detection of CDP in Selenium, Puppeteer, and Playwright.
upload_time2024-07-19 10:03:30
maintainerNone
docs_urlNone
authorMaehdakvan
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PyStealth 🕵️‍♂️

PyStealth is a powerful Python module designed to enhance the stealth capabilities of your web automation projects. It works seamlessly with popular frameworks like Selenium, Puppeteer, and Playwright to prevent detection of CDP.

### 🛡️ Key Features

- 🔒 Prevents stack trace access, making it harder to detect automation
- 🌐 Compatible with Selenium, Puppeteer, and Playwright
- 🎭 Enhances the stealth of your web scraping and testing projects
- 🔧 Easy to integrate with existing code

## 🔧 Installation

Install PyStealth easily with pip:

```bash
pip install pystealth
```

## 🚀 Quick Start

Here's how to use PyStealth with different frameworks:

### Selenium

```python
from selenium import webdriver
from pystealth import PyStealth

driver = webdriver.Chrome()
PyStealth.setup_selenium(driver)
```

### Pyppeteer

```python
import asyncio
from pyppeteer import launch
from pystealth import PyStealth

async def main():
    browser = await launch()
    page = await browser.newPage()
    await PyStealth.setup_pyppeteer(page)
    
asyncio.get_event_loop().run_until_complete(main())
```

### Playwright

```python
from playwright.async_api import async_playwright
from pystealth import PyStealth

async def main():
    async with async_playwright() as p:
        browser = await p.chromium.launch()
        page = await browser.new_page()
        await PyStealth.setup_playwright(page)

asyncio.run(main())
```

### Playwright over CDP

```python
import asyncio
from playwright.async_api import async_playwright
from pystealth import PyStealth

async def main():
    port = 9222  # Replace with your CDP port
    ws_endpoint = "/devtools/browser/..."  # Replace with your WebSocket endpoint

    async with async_playwright().start():
        browser = await p.chromium.connect_over_cdp(f'ws://127.0.0.1:{port}{ws_endpoint}')
        context = browser.contexts[0]
        page = context.pages[0]

        await PyStealth.setup_playwright(page)

        # Your automation code here

        await browser.close()

asyncio.run(main())
```

## 🤝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check [issues page](https://github.com/DedInc/pystealth/issues).

## 📜 License

Distributed under the MIT License. See `LICENSE` for more information.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/DedInc/pystealth",
    "name": "pystealth",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Maehdakvan",
    "author_email": "visitanimation@google.com",
    "download_url": "https://files.pythonhosted.org/packages/c5/8b/836b27e1eb9115e626541ab0ccb6abeb894de46d2b5f3709c83d41e026eb/pystealth-1.0.0.tar.gz",
    "platform": null,
    "description": "# PyStealth \ud83d\udd75\ufe0f\u200d\u2642\ufe0f\r\n\r\nPyStealth is a powerful Python module designed to enhance the stealth capabilities of your web automation projects. It works seamlessly with popular frameworks like Selenium, Puppeteer, and Playwright to prevent detection of CDP.\r\n\r\n### \ud83d\udee1\ufe0f Key Features\r\n\r\n- \ud83d\udd12 Prevents stack trace access, making it harder to detect automation\r\n- \ud83c\udf10 Compatible with Selenium, Puppeteer, and Playwright\r\n- \ud83c\udfad Enhances the stealth of your web scraping and testing projects\r\n- \ud83d\udd27 Easy to integrate with existing code\r\n\r\n## \ud83d\udd27 Installation\r\n\r\nInstall PyStealth easily with pip:\r\n\r\n```bash\r\npip install pystealth\r\n```\r\n\r\n## \ud83d\ude80 Quick Start\r\n\r\nHere's how to use PyStealth with different frameworks:\r\n\r\n### Selenium\r\n\r\n```python\r\nfrom selenium import webdriver\r\nfrom pystealth import PyStealth\r\n\r\ndriver = webdriver.Chrome()\r\nPyStealth.setup_selenium(driver)\r\n```\r\n\r\n### Pyppeteer\r\n\r\n```python\r\nimport asyncio\r\nfrom pyppeteer import launch\r\nfrom pystealth import PyStealth\r\n\r\nasync def main():\r\n    browser = await launch()\r\n    page = await browser.newPage()\r\n    await PyStealth.setup_pyppeteer(page)\r\n    \r\nasyncio.get_event_loop().run_until_complete(main())\r\n```\r\n\r\n### Playwright\r\n\r\n```python\r\nfrom playwright.async_api import async_playwright\r\nfrom pystealth import PyStealth\r\n\r\nasync def main():\r\n    async with async_playwright() as p:\r\n        browser = await p.chromium.launch()\r\n        page = await browser.new_page()\r\n        await PyStealth.setup_playwright(page)\r\n\r\nasyncio.run(main())\r\n```\r\n\r\n### Playwright over CDP\r\n\r\n```python\r\nimport asyncio\r\nfrom playwright.async_api import async_playwright\r\nfrom pystealth import PyStealth\r\n\r\nasync def main():\r\n    port = 9222  # Replace with your CDP port\r\n    ws_endpoint = \"/devtools/browser/...\"  # Replace with your WebSocket endpoint\r\n\r\n    async with async_playwright().start():\r\n        browser = await p.chromium.connect_over_cdp(f'ws://127.0.0.1:{port}{ws_endpoint}')\r\n        context = browser.contexts[0]\r\n        page = context.pages[0]\r\n\r\n        await PyStealth.setup_playwright(page)\r\n\r\n        # Your automation code here\r\n\r\n        await browser.close()\r\n\r\nasyncio.run(main())\r\n```\r\n\r\n## \ud83e\udd1d Contributing\r\n\r\nContributions, issues, and feature requests are welcome! Feel free to check [issues page](https://github.com/DedInc/pystealth/issues).\r\n\r\n## \ud83d\udcdc License\r\n\r\nDistributed under the MIT License. See `LICENSE` for more information.\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python module for preventing detection of CDP in Selenium, Puppeteer, and Playwright.",
    "version": "1.0.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/DedInc/pystealth/issues",
        "Homepage": "https://github.com/DedInc/pystealth"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f5089869508dead36703ff6196699d79fd1cd4f4e0953adc69fd04d67f957578",
                "md5": "741f424bc9f767741eee90a0d2c5ecf0",
                "sha256": "688232bd8ba01687de255961dc585fbd6f636c5a771396424cc34a857161175f"
            },
            "downloads": -1,
            "filename": "pystealth-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "741f424bc9f767741eee90a0d2c5ecf0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 4140,
            "upload_time": "2024-07-19T10:03:28",
            "upload_time_iso_8601": "2024-07-19T10:03:28.610303Z",
            "url": "https://files.pythonhosted.org/packages/f5/08/9869508dead36703ff6196699d79fd1cd4f4e0953adc69fd04d67f957578/pystealth-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c58b836b27e1eb9115e626541ab0ccb6abeb894de46d2b5f3709c83d41e026eb",
                "md5": "e14efc7cd2380c6df4c8c1233e1b5e24",
                "sha256": "2946e7785ef357a63d9bf7dd86498f7b03a7e276205fb0303d855cd38cd4867c"
            },
            "downloads": -1,
            "filename": "pystealth-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e14efc7cd2380c6df4c8c1233e1b5e24",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 3906,
            "upload_time": "2024-07-19T10:03:30",
            "upload_time_iso_8601": "2024-07-19T10:03:30.234085Z",
            "url": "https://files.pythonhosted.org/packages/c5/8b/836b27e1eb9115e626541ab0ccb6abeb894de46d2b5f3709c83d41e026eb/pystealth-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-19 10:03:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "DedInc",
    "github_project": "pystealth",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pystealth"
}
        
Elapsed time: 2.56966s