reqdriver


Namereqdriver JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/glizzykingdreko/reqdriver
SummaryEffortlessly transfer sessions from Python requests to Selenium WebDriver.
upload_time2023-12-18 04:14:26
maintainer
docs_urlNone
authorglizzykingdreko
requires_python
license
keywords web scraping browser automation selenium webdriver python requests session transfer automated testing web automation selenium browser http requests cookie management proxy handling selenium sessions web testing data scraping selenium cookies
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # reqdriver

A Python package that seamlessly transfers a `requests.Session` to a Selenium WebDriver, maintaining session cookies and proxy settings. Ideal for web scraping and automated browsing with pre-established session states.

![banner](https://raw.githubusercontent.com/glizzykingdreko/reqdriver/main/img/banner.jpg)

<p align="center">
    <a href="https://pypi.org/project/reqdriver/">
        <img src="https://img.shields.io/pypi/v/reqdriver.svg" alt="PyPI Version"/>
    </a>
    <a href="https://github.com/glizzykingdreko/reqdriver">
        <img src="https://img.shields.io/badge/GitHub-glizzykingdreko%2Freqdriver-g" alt="GlizzykingDreko"/>
    </a>
</p>

## Features

- **Transfer Session Cookies**: Easily transfer cookies from a `requests.Session` to a Selenium WebDriver.
- **Proxy Integration**: Set up a Chrome WebDriver with the same proxy settings as your `requests.Session`.
- **Flexible WebDriver Management**: Use an existing WebDriver instance or let reqdriver create one for you.
- **Custom WebDriver Options**: Customize your WebDriver with additional options.

## Installation

```bash
pip install reqdriver
```

## Usage

### Basic Usage

Import the `RequestsDriver` class from the `reqdriver` package:

```python
from reqdriver import RequestsDriver
import requests
```

### Transferring Cookies

Transfer cookies from a `requests.Session`:

```python
session = requests.Session()
session.cookies.set('test_cookie', '12345', domain='example.com')

req_driver = RequestsDriver(session)
req_driver.set_cookies('http://example.com')

driver = req_driver.get_driver()
driver.get('http://example.com')
```

### Setting Proxies

Set up a WebDriver with the same proxy settings as your `requests.Session`:

```python
session = requests.Session()
session.proxies = {
    'http': 'http://192.168.3.2:8080'
}

req_driver = RequestsDriver(session)
driver = req_driver.get_driver()
driver.get('http://example.com')
```

### Using Custom WebDriver Options

Pass your custom Chrome WebDriver options:

```python
from selenium.webdriver.chrome.options import Options

custom_options = Options()
custom_options.add_argument('--headless')

session = requests.Session()
req_driver = RequestsDriver(session, custom_options=custom_options)

driver = req_driver.get_driver()
driver.get('http://example.com')
```

### Using Existing WebDriver

Pass your already created WebDriver instance:

```python
from selenium import webdriver

existing_driver = webdriver.Chrome(executable_path='path_to_chromedriver')
session = requests.Session()
req_driver = RequestsDriver(session, driver=existing_driver)

req_driver.set_cookies('http://example.com')
existing_driver.get('http://example.com')
```

## Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

## License

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


## My links

- [Website](https://glizzykingdreko.github.io/)
- [GitHub](https://github.com/glizzykingdreko)
- [Twitter](https://mobile.twitter.com/glizzykingdreko)
- [Medium](https://medium.com/@glizzykingdreko)
- [Email](mailto:glizzykingdreko@protonmail.com)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/glizzykingdreko/reqdriver",
    "name": "reqdriver",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "web scraping browser automation selenium webdriver python requests session transfer automated testing web automation selenium browser http requests cookie management proxy handling selenium sessions web testing data scraping selenium cookies",
    "author": "glizzykingdreko",
    "author_email": "glizzykingdreko@protonmail.com",
    "download_url": "https://files.pythonhosted.org/packages/52/31/8cb580198398671b329ffd464a32e576e1369652647dee7e586fb34cfe89/reqdriver-0.1.2.tar.gz",
    "platform": null,
    "description": "# reqdriver\n\nA Python package that seamlessly transfers a `requests.Session` to a Selenium WebDriver, maintaining session cookies and proxy settings. Ideal for web scraping and automated browsing with pre-established session states.\n\n![banner](https://raw.githubusercontent.com/glizzykingdreko/reqdriver/main/img/banner.jpg)\n\n<p align=\"center\">\n    <a href=\"https://pypi.org/project/reqdriver/\">\n        <img src=\"https://img.shields.io/pypi/v/reqdriver.svg\" alt=\"PyPI Version\"/>\n    </a>\n    <a href=\"https://github.com/glizzykingdreko/reqdriver\">\n        <img src=\"https://img.shields.io/badge/GitHub-glizzykingdreko%2Freqdriver-g\" alt=\"GlizzykingDreko\"/>\n    </a>\n</p>\n\n## Features\n\n- **Transfer Session Cookies**: Easily transfer cookies from a `requests.Session` to a Selenium WebDriver.\n- **Proxy Integration**: Set up a Chrome WebDriver with the same proxy settings as your `requests.Session`.\n- **Flexible WebDriver Management**: Use an existing WebDriver instance or let reqdriver create one for you.\n- **Custom WebDriver Options**: Customize your WebDriver with additional options.\n\n## Installation\n\n```bash\npip install reqdriver\n```\n\n## Usage\n\n### Basic Usage\n\nImport the `RequestsDriver` class from the `reqdriver` package:\n\n```python\nfrom reqdriver import RequestsDriver\nimport requests\n```\n\n### Transferring Cookies\n\nTransfer cookies from a `requests.Session`:\n\n```python\nsession = requests.Session()\nsession.cookies.set('test_cookie', '12345', domain='example.com')\n\nreq_driver = RequestsDriver(session)\nreq_driver.set_cookies('http://example.com')\n\ndriver = req_driver.get_driver()\ndriver.get('http://example.com')\n```\n\n### Setting Proxies\n\nSet up a WebDriver with the same proxy settings as your `requests.Session`:\n\n```python\nsession = requests.Session()\nsession.proxies = {\n    'http': 'http://192.168.3.2:8080'\n}\n\nreq_driver = RequestsDriver(session)\ndriver = req_driver.get_driver()\ndriver.get('http://example.com')\n```\n\n### Using Custom WebDriver Options\n\nPass your custom Chrome WebDriver options:\n\n```python\nfrom selenium.webdriver.chrome.options import Options\n\ncustom_options = Options()\ncustom_options.add_argument('--headless')\n\nsession = requests.Session()\nreq_driver = RequestsDriver(session, custom_options=custom_options)\n\ndriver = req_driver.get_driver()\ndriver.get('http://example.com')\n```\n\n### Using Existing WebDriver\n\nPass your already created WebDriver instance:\n\n```python\nfrom selenium import webdriver\n\nexisting_driver = webdriver.Chrome(executable_path='path_to_chromedriver')\nsession = requests.Session()\nreq_driver = RequestsDriver(session, driver=existing_driver)\n\nreq_driver.set_cookies('http://example.com')\nexisting_driver.get('http://example.com')\n```\n\n## Contributing\n\nContributions are welcome! Feel free to open issues or submit pull requests.\n\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n\n## My links\n\n- [Website](https://glizzykingdreko.github.io/)\n- [GitHub](https://github.com/glizzykingdreko)\n- [Twitter](https://mobile.twitter.com/glizzykingdreko)\n- [Medium](https://medium.com/@glizzykingdreko)\n- [Email](mailto:glizzykingdreko@protonmail.com)\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Effortlessly transfer sessions from Python requests to Selenium WebDriver.",
    "version": "0.1.2",
    "project_urls": {
        "Homepage": "https://github.com/glizzykingdreko/reqdriver"
    },
    "split_keywords": [
        "web",
        "scraping",
        "browser",
        "automation",
        "selenium",
        "webdriver",
        "python",
        "requests",
        "session",
        "transfer",
        "automated",
        "testing",
        "web",
        "automation",
        "selenium",
        "browser",
        "http",
        "requests",
        "cookie",
        "management",
        "proxy",
        "handling",
        "selenium",
        "sessions",
        "web",
        "testing",
        "data",
        "scraping",
        "selenium",
        "cookies"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "481a07bec935b369da7a269ecb8b2aa27f0eca2ac896d53a1042a1dbd9de7309",
                "md5": "606adb0e117f0cba96e1a951f8504d11",
                "sha256": "3093dd17d25244642e7e5eeae0976457dbb16448260fba171d88556d28e9e153"
            },
            "downloads": -1,
            "filename": "reqdriver-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "606adb0e117f0cba96e1a951f8504d11",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5232,
            "upload_time": "2023-12-18T04:14:24",
            "upload_time_iso_8601": "2023-12-18T04:14:24.269521Z",
            "url": "https://files.pythonhosted.org/packages/48/1a/07bec935b369da7a269ecb8b2aa27f0eca2ac896d53a1042a1dbd9de7309/reqdriver-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "52318cb580198398671b329ffd464a32e576e1369652647dee7e586fb34cfe89",
                "md5": "020123ad76dbbf4a39dfcfce1fbb8614",
                "sha256": "424d5e4bdb003235c54ecc2798eba19f60eb03a8980b8e649427a0e6bef79073"
            },
            "downloads": -1,
            "filename": "reqdriver-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "020123ad76dbbf4a39dfcfce1fbb8614",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4928,
            "upload_time": "2023-12-18T04:14:26",
            "upload_time_iso_8601": "2023-12-18T04:14:26.419391Z",
            "url": "https://files.pythonhosted.org/packages/52/31/8cb580198398671b329ffd464a32e576e1369652647dee7e586fb34cfe89/reqdriver-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-18 04:14:26",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "glizzykingdreko",
    "github_project": "reqdriver",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "reqdriver"
}
        
Elapsed time: 0.46784s