An open API service indexing awesome lists of open source software.

https://github.com/vladimirkucin634/proxy-session-generator

Python tool to create requests sessions with rotating proxies and retry logic
https://github.com/vladimirkucin634/proxy-session-generator

Last synced: 5 months ago
JSON representation

Python tool to create requests sessions with rotating proxies and retry logic

Awesome Lists containing this project

README

          

# Proxy Session Generator

A Python tool that automatically fetches free HTTP/HTTPS proxies, builds resilient `requests.Session` objects, and applies retry logic for robust web scraping or API interaction.

---

## Proxy Source

Proxies are fetched in real-time from [https://free-proxy-list.net/](https://free-proxy-list.net/), a public site that lists free, updated proxy servers in a tabular format.

---

## Features

- **Automatic proxy list parsing** from an HTML table
- **Retry strategy** using `urllib3.util.retry.Retry` and `HTTPAdapter`
- **Handles common request failures**, such as:
- Connection errors
- Read timeouts
- 4xx/5xx HTTP status codes (`400`, `403`, `429`, `500`, etc.)
- **Proxy selection is random** from the latest proxy list
- **Custom headers support** for realistic browser emulation
- **SSL verification** via `certifi`

---

## Requirements

Install dependencies:

```bash
pip install -r requirements.txt
```