tf-playwright-stealth


Nametf-playwright-stealth JSON
Version 1.1.1 PyPI version JSON
download
home_pagehttps://www.agentql.com/
SummaryMakes playwright stealthy like a ninja!
upload_time2025-01-30 00:51:01
maintainerNone
docs_urlNone
authorNone
requires_python<4.0,>=3.8
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 🥷🏻 tf-playwright-stealth [![PyPI version](https://img.shields.io/pypi/v/tf-playwright-stealth)](https://pypi.org/project/tf-playwright-stealth/) [![AgentQL](https://img.shields.io/badge/AgentQL-AgentQL-informational)](https://agentql.com) [![Join Discord](https://img.shields.io/badge/join-discord-infomational)](https://discord.gg/agentql)



> Transplanted from [puppeteer-extra-plugin-stealth](https://github.com/berstend/puppeteer-extra/tree/master/packages/puppeteer-extra-plugin-stealth).

This is a package that makes playwright stealthy like a ninja by spoofing browser features in order to reduce the chance of detection.

## Install

```
pip install tf-playwright-stealth
```

## Usage

### sync
```python
from playwright.sync_api import sync_playwright
from playwright_stealth import stealth_sync

with sync_playwright() as p:
    browser = p.chromium.launch(
            headless=True,
        )
    page = browser.new_page()
    stealth_sync(page)
    page.goto("https://bot.sannysoft.com/")
    page.screenshot(path=f"example_with_stealth.png", full_page=True)
    browser.close()
```


### async

```python
from playwright.async_api import async_playwright
from playwright_stealth import stealth_async

with async_playwright() as p:
    browser = await p.chromium.launch(
            headless=True,
        )
    page = await browser.new_page()
    await stealth_async(page)
    await page.goto("https://bot.sannysoft.com/")
    await page.screenshot(path=f"example_with_stealth_async.png", full_page=True)
    await browser.close()
```
## Results
From [bot.sannysoft.com](https://bot.sannysoft.com/)
| Headless | Headful |
|----------|---------|
| ![Headless](./images/example_with_stealth_headless.png) | ![Headful](./images/example_with_stealth_headful.png) |

            

Raw data

            {
    "_id": null,
    "home_page": "https://www.agentql.com/",
    "name": "tf-playwright-stealth",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/77/70/88303b126faaeb77a0d8a49d2e0d5bc92c6e9e7b7c1c36dba0ffcc76a4db/tf_playwright_stealth-1.1.1.tar.gz",
    "platform": null,
    "description": "# \ud83e\udd77\ud83c\udffb tf-playwright-stealth [![PyPI version](https://img.shields.io/pypi/v/tf-playwright-stealth)](https://pypi.org/project/tf-playwright-stealth/) [![AgentQL](https://img.shields.io/badge/AgentQL-AgentQL-informational)](https://agentql.com) [![Join Discord](https://img.shields.io/badge/join-discord-infomational)](https://discord.gg/agentql)\n\n\n\n> Transplanted from [puppeteer-extra-plugin-stealth](https://github.com/berstend/puppeteer-extra/tree/master/packages/puppeteer-extra-plugin-stealth).\n\nThis is a package that makes playwright stealthy like a ninja by spoofing browser features in order to reduce the chance of detection.\n\n## Install\n\n```\npip install tf-playwright-stealth\n```\n\n## Usage\n\n### sync\n```python\nfrom playwright.sync_api import sync_playwright\nfrom playwright_stealth import stealth_sync\n\nwith sync_playwright() as p:\n    browser = p.chromium.launch(\n            headless=True,\n        )\n    page = browser.new_page()\n    stealth_sync(page)\n    page.goto(\"https://bot.sannysoft.com/\")\n    page.screenshot(path=f\"example_with_stealth.png\", full_page=True)\n    browser.close()\n```\n\n\n### async\n\n```python\nfrom playwright.async_api import async_playwright\nfrom playwright_stealth import stealth_async\n\nwith async_playwright() as p:\n    browser = await p.chromium.launch(\n            headless=True,\n        )\n    page = await browser.new_page()\n    await stealth_async(page)\n    await page.goto(\"https://bot.sannysoft.com/\")\n    await page.screenshot(path=f\"example_with_stealth_async.png\", full_page=True)\n    await browser.close()\n```\n## Results\nFrom [bot.sannysoft.com](https://bot.sannysoft.com/)\n| Headless | Headful |\n|----------|---------|\n| ![Headless](./images/example_with_stealth_headless.png) | ![Headful](./images/example_with_stealth_headful.png) |\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Makes playwright stealthy like a ninja!",
    "version": "1.1.1",
    "project_urls": {
        "Homepage": "https://www.agentql.com/",
        "Repository": "https://github.com/tinyfish-io/tf-playwright-stealth"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "061b4a2dcfedf88923b8b022f566042006a6d871235d9c6f633866a9a640cc51",
                "md5": "c75be7416a35461d76a4fa04b5bdcfe6",
                "sha256": "7cc4785bcafca17c8987919591eab569c180b0d6159ce058807398ba616d6696"
            },
            "downloads": -1,
            "filename": "tf_playwright_stealth-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c75be7416a35461d76a4fa04b5bdcfe6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 32998,
            "upload_time": "2025-01-30T00:51:00",
            "upload_time_iso_8601": "2025-01-30T00:51:00.219756Z",
            "url": "https://files.pythonhosted.org/packages/06/1b/4a2dcfedf88923b8b022f566042006a6d871235d9c6f633866a9a640cc51/tf_playwright_stealth-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "777088303b126faaeb77a0d8a49d2e0d5bc92c6e9e7b7c1c36dba0ffcc76a4db",
                "md5": "c7213b240cce145d0cc4e670ec945a8b",
                "sha256": "204322326a629542a92ad4ea0c48f37d6e22662cf560d81b69e6464cf2742ce3"
            },
            "downloads": -1,
            "filename": "tf_playwright_stealth-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "c7213b240cce145d0cc4e670ec945a8b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 23169,
            "upload_time": "2025-01-30T00:51:01",
            "upload_time_iso_8601": "2025-01-30T00:51:01.854106Z",
            "url": "https://files.pythonhosted.org/packages/77/70/88303b126faaeb77a0d8a49d2e0d5bc92c6e9e7b7c1c36dba0ffcc76a4db/tf_playwright_stealth-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-30 00:51:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tinyfish-io",
    "github_project": "tf-playwright-stealth",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "tf-playwright-stealth"
}
        
Elapsed time: 0.77723s