pyppeteerstealth


Namepyppeteerstealth JSON
Version 0.0.5 PyPI version JSON
download
home_pagehttps://github.com/dgtlmoon/pyppeteerstealth
SummaryA general collection of robot-evading tweaks for pyppeteer-ng
upload_time2024-10-03 17:36:02
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseMIT
keywords pyppeteer puppeteer chrome chromium pyppeteerstealth stealth robot captcha
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyppeteerstealth

A bunch of hacks from different websites

## Note!
- **Does not yet pass https://arh.antoinevastel.com/bots/areyouheadless** please help!
- Probably wont help where sites are using https://developer.mozilla.org/en-US/docs/Web/API/User-Agent_Client_Hints_API (`navigator.userAgentData.brands` etc)
- Designed to work with the puppeteer fetcher at https://changedetection.io
 
__**If you know what is missing, please make a PR!!!**__

If you compare loading https://arh.antoinevastel.com/bots/ in your application, versus in your browser you might be able
to see what is required to get the fingerprint closer to a "normal" browser (further away from a "headless" browser)

This is intended to be used with https://github.com/dgtlmoon/pyppeteer-ng and is also part of the 
https://changedetection.io project.

```python
browser = await pyppeteer_instance.connect(browserWSEndpoint="ws://127.0.0.1:3000",
                                           ignoreHTTPSErrors=True
                                           )

self.page = (pages := await browser.pages) and len(pages) or await browser.newPage()
# Should be set with setUserAgent
user_agent = next((value for key, value in request_headers.items() if key.lower().strip() == 'user-agent'), DEFAULT_USER_AGENT)
await self.page.setUserAgent(user_agent)

try:
    from pyppeteerstealth import inject_evasions_into_page
except ImportError:
    logger.debug("pyppeteerstealth module not available, skipping")
    pass
else:
    await inject_evasions_into_page(self.page)

response = await self.page.goto("https://example.com", waitUntil="load")
```

Last report from https://bot.sannysoft.com/

![last fingerprint status](assets/last-screenshot.png "Last fingerprint status")


### Other related interesting projects/alternatives
- https://github.com/MeiK2333/pyppeteer_stealth



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dgtlmoon/pyppeteerstealth",
    "name": "pyppeteerstealth",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "pyppeteer, puppeteer, chrome, chromium, pyppeteerstealth, stealth, robot, captcha",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/0e/b1/0827f4b6ccbd74d729159a3e9060152fc15fd8a6cda5f5c8d91b31df5256/pyppeteerstealth-0.0.5.tar.gz",
    "platform": null,
    "description": "# pyppeteerstealth\n\nA bunch of hacks from different websites\n\n## Note!\n- **Does not yet pass https://arh.antoinevastel.com/bots/areyouheadless** please help!\n- Probably wont help where sites are using https://developer.mozilla.org/en-US/docs/Web/API/User-Agent_Client_Hints_API (`navigator.userAgentData.brands` etc)\n- Designed to work with the puppeteer fetcher at https://changedetection.io\n \n__**If you know what is missing, please make a PR!!!**__\n\nIf you compare loading https://arh.antoinevastel.com/bots/ in your application, versus in your browser you might be able\nto see what is required to get the fingerprint closer to a \"normal\" browser (further away from a \"headless\" browser)\n\nThis is intended to be used with https://github.com/dgtlmoon/pyppeteer-ng and is also part of the \nhttps://changedetection.io project.\n\n```python\nbrowser = await pyppeteer_instance.connect(browserWSEndpoint=\"ws://127.0.0.1:3000\",\n                                           ignoreHTTPSErrors=True\n                                           )\n\nself.page = (pages := await browser.pages) and len(pages) or await browser.newPage()\n# Should be set with setUserAgent\nuser_agent = next((value for key, value in request_headers.items() if key.lower().strip() == 'user-agent'), DEFAULT_USER_AGENT)\nawait self.page.setUserAgent(user_agent)\n\ntry:\n    from pyppeteerstealth import inject_evasions_into_page\nexcept ImportError:\n    logger.debug(\"pyppeteerstealth module not available, skipping\")\n    pass\nelse:\n    await inject_evasions_into_page(self.page)\n\nresponse = await self.page.goto(\"https://example.com\", waitUntil=\"load\")\n```\n\nLast report from https://bot.sannysoft.com/\n\n![last fingerprint status](assets/last-screenshot.png \"Last fingerprint status\")\n\n\n### Other related interesting projects/alternatives\n- https://github.com/MeiK2333/pyppeteer_stealth\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A general collection of robot-evading tweaks for pyppeteer-ng",
    "version": "0.0.5",
    "project_urls": {
        "Bug Tracker": "https://github.com/dgtlmoon/pyppeteerstealth/issues",
        "Homepage": "https://github.com/dgtlmoon/pyppeteerstealth",
        "Repository": "https://github.com/dgtlmoon/pyppeteerstealth"
    },
    "split_keywords": [
        "pyppeteer",
        " puppeteer",
        " chrome",
        " chromium",
        " pyppeteerstealth",
        " stealth",
        " robot",
        " captcha"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7cfa20a8d3d92284f04c0a3be528f4e02aa979db1ba892f8f08c4f497a1503ce",
                "md5": "e4296abc8e2e3c821e4ff201be422ab2",
                "sha256": "5a934e16805fa982f736eaf86ccfbc959a4b8131bb5d3152ce310ab378641549"
            },
            "downloads": -1,
            "filename": "pyppeteerstealth-0.0.5-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e4296abc8e2e3c821e4ff201be422ab2",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 10876,
            "upload_time": "2024-10-03T17:36:01",
            "upload_time_iso_8601": "2024-10-03T17:36:01.636350Z",
            "url": "https://files.pythonhosted.org/packages/7c/fa/20a8d3d92284f04c0a3be528f4e02aa979db1ba892f8f08c4f497a1503ce/pyppeteerstealth-0.0.5-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0eb10827f4b6ccbd74d729159a3e9060152fc15fd8a6cda5f5c8d91b31df5256",
                "md5": "5d3f0a2baf4ea3c9968b8a4fe0de43e0",
                "sha256": "4236a92742049aadf31eb6dd6900f93b98c3486a596676d2b1c7925457c9433b"
            },
            "downloads": -1,
            "filename": "pyppeteerstealth-0.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "5d3f0a2baf4ea3c9968b8a4fe0de43e0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 10057,
            "upload_time": "2024-10-03T17:36:02",
            "upload_time_iso_8601": "2024-10-03T17:36:02.888995Z",
            "url": "https://files.pythonhosted.org/packages/0e/b1/0827f4b6ccbd74d729159a3e9060152fc15fd8a6cda5f5c8d91b31df5256/pyppeteerstealth-0.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-03 17:36:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dgtlmoon",
    "github_project": "pyppeteerstealth",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pyppeteerstealth"
}
        
Elapsed time: 4.47268s