proxyrequest


Nameproxyrequest JSON
Version 0.16 PyPI version JSON
download
home_pageNone
SummaryA Python package for making HTTP requests with proxy support and fetching HTML content using requests or Selenium.
upload_time2025-09-03 06:46:16
maintainerNone
docs_urlNone
authorRamesh Chandra
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # proxyrequest

`proxyrequest` is a Python package that allows you to make HTTP requests and retrieve HTML content using a proxy. It supports both standard HTTP requests and Selenium-based requests for more dynamic content fetching.

## Features

- **Proxy Support**: Easily integrate proxies into your HTTP requests.
- **HTML Content Retrieval**: Fetch HTML content using requests or Selenium.
- **Selenium Integration**: Use Selenium for dynamic pages when requests alone don't suffice.

## Installation

You can install `proxyrequest` via pip:

```bash
pip install proxyrequest

# ================================================================

from proxyrequest import proxy_verifier
# Checks whether the given proxy is working by making a simple HTTP request to a test URL.

# Define your proxy settings (this is just an example, use a valid proxy IP and port)
proxy = {
    "http": "http://proxy_ip:port",
    "https": "https://proxy_ip:port"
}

proxy = {
    "http": "http://10.10.1.10:3128",
    "https": "https://10.10.1.10:1080"
}

# Call the function with the proxy
is_working = proxy_verifier(proxy)

# Print the result
if is_working:
    print("The proxy is working!")
else:
    print("The proxy is not working.")


# Define custom headers
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
    'Accept': 'application/json'
}

# Call the function with custom headers
is_working = proxy_verifier(proxy, headers=headers)

# Print the result
if is_working:
    print("The proxy is working!")
else:
    print("The proxy is not working.")


# Call the function with a custom timeout of 10 seconds
is_working = proxy_verifier(proxy, timeout=10)

# Print the result
if is_working:
    print("The proxy is working!")
else:
    print("The proxy is not working.")


# Call the function with SSL verification disabled
is_working = proxy_verifier(proxy, verify=False)

# Print the result
if is_working:
    print("The proxy is working!")
else:
    print("The proxy is not working.")

# Without Proxy (Direct Request for Public IP)
proxy_verifier(proxy=None)


from proxyrequest import get_request

url = "https://example.com"
response = get_request(url, country="US", protocol="http", max_retries=5)

# Process the response
if response.status_code == 200:
    print("Request was successful!")
    print(response.content)


# Example to fetch and use proxies for multiple requests
from proxyrequest import fetch_proxy_ips, get_request

# Fetch proxies
proxies = fetch_proxy_ips(country="GB", protocol="https", limit=5)

# Example URL
url = "https://httpbin.org/ip"

for proxy in proxies:
    print(f"Using proxy: {proxy['proxy']}")
    response = get_request(url, country="GB", protocol="https")
    if response and response.status_code == 200:
        print(f"Successful response: {response.text}")
    else:
        print("Request failed")

# dynamic content fetching
from proxyrequest import get_chrome_request_driver

driver = get_chrome_request_driver(
    headless=True,
    proxy="http://127.0.0.1:8080",
    window_size="1366,768"
)

if driver:
    driver.get("https://httpbin.org/ip")
    print(driver.page_source)
    driver.quit()



            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "proxyrequest",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Ramesh Chandra",
    "author_email": "rameshsofter@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/c1/8b/2a030a85bae48a2d208e9a48aac9d301b7e7d040edf595321078479fcaf2/proxyrequest-0.16.tar.gz",
    "platform": null,
    "description": "# proxyrequest\r\n\r\n`proxyrequest` is a Python package that allows you to make HTTP requests and retrieve HTML content using a proxy. It supports both standard HTTP requests and Selenium-based requests for more dynamic content fetching.\r\n\r\n## Features\r\n\r\n- **Proxy Support**: Easily integrate proxies into your HTTP requests.\r\n- **HTML Content Retrieval**: Fetch HTML content using requests or Selenium.\r\n- **Selenium Integration**: Use Selenium for dynamic pages when requests alone don't suffice.\r\n\r\n## Installation\r\n\r\nYou can install `proxyrequest` via pip:\r\n\r\n```bash\r\npip install proxyrequest\r\n\r\n# ================================================================\r\n\r\nfrom proxyrequest import proxy_verifier\r\n# Checks whether the given proxy is working by making a simple HTTP request to a test URL.\r\n\r\n# Define your proxy settings (this is just an example, use a valid proxy IP and port)\r\nproxy = {\r\n    \"http\": \"http://proxy_ip:port\",\r\n    \"https\": \"https://proxy_ip:port\"\r\n}\r\n\r\nproxy = {\r\n    \"http\": \"http://10.10.1.10:3128\",\r\n    \"https\": \"https://10.10.1.10:1080\"\r\n}\r\n\r\n# Call the function with the proxy\r\nis_working = proxy_verifier(proxy)\r\n\r\n# Print the result\r\nif is_working:\r\n    print(\"The proxy is working!\")\r\nelse:\r\n    print(\"The proxy is not working.\")\r\n\r\n\r\n# Define custom headers\r\nheaders = {\r\n    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',\r\n    'Accept': 'application/json'\r\n}\r\n\r\n# Call the function with custom headers\r\nis_working = proxy_verifier(proxy, headers=headers)\r\n\r\n# Print the result\r\nif is_working:\r\n    print(\"The proxy is working!\")\r\nelse:\r\n    print(\"The proxy is not working.\")\r\n\r\n\r\n# Call the function with a custom timeout of 10 seconds\r\nis_working = proxy_verifier(proxy, timeout=10)\r\n\r\n# Print the result\r\nif is_working:\r\n    print(\"The proxy is working!\")\r\nelse:\r\n    print(\"The proxy is not working.\")\r\n\r\n\r\n# Call the function with SSL verification disabled\r\nis_working = proxy_verifier(proxy, verify=False)\r\n\r\n# Print the result\r\nif is_working:\r\n    print(\"The proxy is working!\")\r\nelse:\r\n    print(\"The proxy is not working.\")\r\n\r\n# Without Proxy (Direct Request for Public IP)\r\nproxy_verifier(proxy=None)\r\n\r\n\r\nfrom proxyrequest import get_request\r\n\r\nurl = \"https://example.com\"\r\nresponse = get_request(url, country=\"US\", protocol=\"http\", max_retries=5)\r\n\r\n# Process the response\r\nif response.status_code == 200:\r\n    print(\"Request was successful!\")\r\n    print(response.content)\r\n\r\n\r\n# Example to fetch and use proxies for multiple requests\r\nfrom proxyrequest import fetch_proxy_ips, get_request\r\n\r\n# Fetch proxies\r\nproxies = fetch_proxy_ips(country=\"GB\", protocol=\"https\", limit=5)\r\n\r\n# Example URL\r\nurl = \"https://httpbin.org/ip\"\r\n\r\nfor proxy in proxies:\r\n    print(f\"Using proxy: {proxy['proxy']}\")\r\n    response = get_request(url, country=\"GB\", protocol=\"https\")\r\n    if response and response.status_code == 200:\r\n        print(f\"Successful response: {response.text}\")\r\n    else:\r\n        print(\"Request failed\")\r\n\r\n# dynamic content fetching\r\nfrom proxyrequest import get_chrome_request_driver\r\n\r\ndriver = get_chrome_request_driver(\r\n    headless=True,\r\n    proxy=\"http://127.0.0.1:8080\",\r\n    window_size=\"1366,768\"\r\n)\r\n\r\nif driver:\r\n    driver.get(\"https://httpbin.org/ip\")\r\n    print(driver.page_source)\r\n    driver.quit()\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python package for making HTTP requests with proxy support and fetching HTML content using requests or Selenium.",
    "version": "0.16",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b4badb8a05ab5f2f99c686b556e49e100d45eb233f3aa5d00ec5fd535f5eb3de",
                "md5": "9a34764d246140fa48d78f5285aeedb6",
                "sha256": "1da7f0aa43fa49148eccad57eb4c3718c767877ea18d15c439beaba51fbc9304"
            },
            "downloads": -1,
            "filename": "proxyrequest-0.16-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9a34764d246140fa48d78f5285aeedb6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 10086,
            "upload_time": "2025-09-03T06:46:15",
            "upload_time_iso_8601": "2025-09-03T06:46:15.530492Z",
            "url": "https://files.pythonhosted.org/packages/b4/ba/db8a05ab5f2f99c686b556e49e100d45eb233f3aa5d00ec5fd535f5eb3de/proxyrequest-0.16-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c18b2a030a85bae48a2d208e9a48aac9d301b7e7d040edf595321078479fcaf2",
                "md5": "404e203790bc2f74efa829d45f279020",
                "sha256": "529ae5141150d01ba1dd6b0f0a453bf325cab934f09eafaf5eff23911fcece9a"
            },
            "downloads": -1,
            "filename": "proxyrequest-0.16.tar.gz",
            "has_sig": false,
            "md5_digest": "404e203790bc2f74efa829d45f279020",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 10523,
            "upload_time": "2025-09-03T06:46:16",
            "upload_time_iso_8601": "2025-09-03T06:46:16.876831Z",
            "url": "https://files.pythonhosted.org/packages/c1/8b/2a030a85bae48a2d208e9a48aac9d301b7e7d040edf595321078479fcaf2/proxyrequest-0.16.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-03 06:46:16",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "proxyrequest"
}
        
Elapsed time: 0.93258s