Skip to main content

Library for working wih proxies

Project description

MetamorProxies Logo

MetamorProxies

CI Status Code Coverage PyPI Version License


MetamorProxies is a Python library that provides tools for web automation and proxy management. This library includes functionality for taking website screenshots and testing SOCKS5 proxies, making it useful for web scraping, automation, and network testing tasks.

Features

  • Website Screenshots : Capture screenshots of websites using headless Chrome browser
  • Proxy Testing : Test SOCKS5 proxies for functionality and reliability
  • Proxy Management : Fetch and validate proxy lists from external sources
  • Headless Automation : Run browser automation without GUI
  • Flexible Configuration : Customizable screenshot settings and proxy testing parameters

Installation

Using pip (recommended)

MetamorProxies is available on PyPI, and you can install it with pip:

pip install metamorproxies

Alternatively, you can install the latest version directly from the GitHub repository:

pip install git+https://github.com/your-username/metamorproxies.git

From source

Clone the repository and install dependencies:

git clone https://github.com/your-username/metamorproxies.git
cd metamorproxies
pip install -r requirements.txt
python setup.py install

Usage

Taking Website Screenshots

The main functionality of MetamorProxies is capturing screenshots of websites using the PrintWeb class:

from metamorproxies.soldier import PrintWeb

# Initialize PrintWeb with URL and output path
url = "https://www.example.com"
output_path = "screenshot.png"
printer = PrintWeb(url, output_path)

# Take the screenshot
printer.take_screenshot()
print(f"Screenshot saved as {output_path}")

Advanced Screenshot Usage

You can also change the output path after initialization:

from metamorproxies.soldier import PrintWeb

# Initialize with default output path
printer = PrintWeb("https://www.example.com")

# Change the output path
printer.set_path("custom_screenshot.png")

# Take the screenshot
printer.take_screenshot()

Proxy Testing and Management

MetamorProxies also includes functionality for testing SOCKS5 proxies:

from proxy import get_proxies_from_url, test_proxy

# Get proxies from a URL
proxy_url = "https://raw.githubusercontent.com/TheSpeedX/SOCKS-List/master/socks5.txt"
proxy_list = get_proxies_from_url(proxy_url)

# Test each proxy
for proxy in proxy_list[:10]:  # Test first 10 proxies
    if test_proxy(proxy):
        print(f"Working proxy: {proxy}")
        # Save working proxy to file
        with open("working_proxies.txt", "a") as file:
            file.write(proxy + "\n")

Complete Example

Here's a complete example that combines both functionalities:

import os
from metamorproxies.soldier import PrintWeb
from proxy import get_proxies_from_url, test_proxy

# Take a screenshot of a website
url = "https://www.reysofts.com"
output_path = "screenshot.png"
printer = PrintWeb(url, output_path)
printer.take_screenshot()

# Verify the screenshot was created
if os.path.exists(output_path):
    print(f"Screenshot successfully created: {output_path}")

# Test some proxies
proxy_url = "https://raw.githubusercontent.com/TheSpeedX/SOCKS-List/master/socks5.txt"
proxy_list = get_proxies_from_url(proxy_url)

working_proxies = []
for proxy in proxy_list[:5]:  # Test first 5 proxies
    if test_proxy(proxy):
        working_proxies.append(proxy)

print(f"Found {len(working_proxies)} working proxies")

Dependencies

MetamorProxies requires the following main dependencies:

  • selenium - For browser automation
  • webdriver-manager - For automatic Chrome driver management
  • requests - For HTTP requests and proxy testing
  • kitano - Additional utility library

Documentation

For more detailed documentation on how to use MetamorProxies and all its features, check out the documentation.

Contributing

We welcome contributions from the community! If you'd like to contribute to MetamorProxies, please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-name).
  3. Make your changes and commit them (git commit -am 'Add feature').
  4. Push to your branch (git push origin feature-name).
  5. Open a pull request.

Please make sure your code follows the existing style conventions, and include tests for new features or fixes.

License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

metamorproxies-0.3.9-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file metamorproxies-0.3.9-py3-none-any.whl.

File metadata

  • Download URL: metamorproxies-0.3.9-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for metamorproxies-0.3.9-py3-none-any.whl
Algorithm Hash digest
SHA256 394780e52b858cf8af758c5b1268789ad853551dece86c5fa986935f1f53ff39
MD5 f8c51d64164204b73a5b3fcdb389d7ef
BLAKE2b-256 2903f6b0e7d2352fdca5760b4d0c74b91500e8777674686db17c4898c0b3c84b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page