selenium-authenticated-proxy


Nameselenium-authenticated-proxy JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/bubblegumsoldier/selenium-authenticated-proxy
SummaryA python package to add authenticated proxy support to selenium.
upload_time2023-09-08 06:36:07
maintainer
docs_urlNone
authorHenry Müssemann
requires_python
licenseMIT
keywords proxy selenium auth selenium
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Selenium Authenticated Proxy Helper

## Overview

The Selenium Authenticated Proxy Helper is a Python utility designed to seamlessly handle proxy authentication when using Selenium WebDriver. This package generates a Chrome extension that takes care of proxy authentication, allowing you to focus more on web scraping or automation tasks, without worrying about the intricacies of proxy setup.

## Features

- **Proxy Authentication**: Supports username and password authentication for proxy servers.
- **Unique Identification**: Generates a unique Chrome extension for each different set of proxy credentials.
- **Ease of Use**: Simple API to generate and use the extension with your existing Selenium Chrome WebDriver setup.
- **Temporary Storage**: Optionally, specify a folder for temporary storage of generated Chrome extensions.

## Requirements

- Python 3.6 or higher
- Selenium WebDriver

## Installation

You can install this package via pip:

```bash
pip install selenium-authenticated-proxy
```

## Usage

### Basic Usage

Here is how you can set up the authenticated proxy for Selenium's Chrome WebDriver:

```python
from selenium import webdriver
from selenium_authenticated_proxy import SeleniumAuthenticatedProxy

# Initialize Chrome options
chrome_options = webdriver.ChromeOptions()

# Initialize SeleniumAuthenticatedProxy
proxy_helper = SeleniumAuthenticatedProxy(proxy_url="http://username:password@proxy-server.com")

# Enrich Chrome options with proxy authentication
proxy_helper.enrich_chrome_options(chrome_options)

# Start WebDriver with enriched options
driver = webdriver.Chrome(chrome_options=chrome_options)

# Your automation or scraping code here
```

### Custom Temporary Folder

You can specify a custom folder for temporary storage of generated Chrome extensions.

```python
proxy_helper = SeleniumAuthenticatedProxy(proxy_url="http://username:password@proxy-server.com", tmp_folder="/path/to/tmp/folder")
```

To enable the authentication to work properly a chrome extension is being generated (Thanks to [itsmnthn](https://stackoverflow.com/a/55582859/3691763) with an [improvement for manifest v3](https://bugs.chromium.org/p/chromium/issues/detail?id=1135492)).
If the URl doesn't change the extension will not be regenerated. The URL is hashed so that only when the URL has changed (or the tmp folder has changed) a new zip file will be generated.


## License

This project is licensed under the MIT License - see the LICENSE.md file for details.




            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/bubblegumsoldier/selenium-authenticated-proxy",
    "name": "selenium-authenticated-proxy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "proxy,selenium,auth,selenium",
    "author": "Henry M\u00fcssemann",
    "author_email": "hm@freezingdata.de",
    "download_url": "",
    "platform": null,
    "description": "# Selenium Authenticated Proxy Helper\n\n## Overview\n\nThe Selenium Authenticated Proxy Helper is a Python utility designed to seamlessly handle proxy authentication when using Selenium WebDriver. This package generates a Chrome extension that takes care of proxy authentication, allowing you to focus more on web scraping or automation tasks, without worrying about the intricacies of proxy setup.\n\n## Features\n\n- **Proxy Authentication**: Supports username and password authentication for proxy servers.\n- **Unique Identification**: Generates a unique Chrome extension for each different set of proxy credentials.\n- **Ease of Use**: Simple API to generate and use the extension with your existing Selenium Chrome WebDriver setup.\n- **Temporary Storage**: Optionally, specify a folder for temporary storage of generated Chrome extensions.\n\n## Requirements\n\n- Python 3.6 or higher\n- Selenium WebDriver\n\n## Installation\n\nYou can install this package via pip:\n\n```bash\npip install selenium-authenticated-proxy\n```\n\n## Usage\n\n### Basic Usage\n\nHere is how you can set up the authenticated proxy for Selenium's Chrome WebDriver:\n\n```python\nfrom selenium import webdriver\nfrom selenium_authenticated_proxy import SeleniumAuthenticatedProxy\n\n# Initialize Chrome options\nchrome_options = webdriver.ChromeOptions()\n\n# Initialize SeleniumAuthenticatedProxy\nproxy_helper = SeleniumAuthenticatedProxy(proxy_url=\"http://username:password@proxy-server.com\")\n\n# Enrich Chrome options with proxy authentication\nproxy_helper.enrich_chrome_options(chrome_options)\n\n# Start WebDriver with enriched options\ndriver = webdriver.Chrome(chrome_options=chrome_options)\n\n# Your automation or scraping code here\n```\n\n### Custom Temporary Folder\n\nYou can specify a custom folder for temporary storage of generated Chrome extensions.\n\n```python\nproxy_helper = SeleniumAuthenticatedProxy(proxy_url=\"http://username:password@proxy-server.com\", tmp_folder=\"/path/to/tmp/folder\")\n```\n\nTo enable the authentication to work properly a chrome extension is being generated (Thanks to [itsmnthn](https://stackoverflow.com/a/55582859/3691763) with an [improvement for manifest v3](https://bugs.chromium.org/p/chromium/issues/detail?id=1135492)).\nIf the URl doesn't change the extension will not be regenerated. The URL is hashed so that only when the URL has changed (or the tmp folder has changed) a new zip file will be generated.\n\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE.md file for details.\n\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A python package to add authenticated proxy support to selenium.",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/bubblegumsoldier/selenium-authenticated-proxy"
    },
    "split_keywords": [
        "proxy",
        "selenium",
        "auth",
        "selenium"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1a44ca81d24b1f877e09e46513f9ce5309b4495a9806c443b0b801afdb57becd",
                "md5": "572780986f76a4b892cf31d03c54d028",
                "sha256": "493ebaa5a9e0f9e747eea921730768985efaf408fb7f47c2d82476359d3a14ec"
            },
            "downloads": -1,
            "filename": "selenium_authenticated_proxy-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "572780986f76a4b892cf31d03c54d028",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5502,
            "upload_time": "2023-09-08T06:36:07",
            "upload_time_iso_8601": "2023-09-08T06:36:07.105332Z",
            "url": "https://files.pythonhosted.org/packages/1a/44/ca81d24b1f877e09e46513f9ce5309b4495a9806c443b0b801afdb57becd/selenium_authenticated_proxy-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-08 06:36:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bubblegumsoldier",
    "github_project": "selenium-authenticated-proxy",
    "github_not_found": true,
    "lcname": "selenium-authenticated-proxy"
}
        
Elapsed time: 0.10857s