Skip to main content

Run an API on your local machine that reroutes traffic through rotating proxies. Useful for pyppeteer proxy rotation.

Project description

async-rotating-proxy

Run an API on your local machine that reroutes traffic through rotating proxies.

  • Excellent for scaling your web scraping
  • Designed for page-by-page dynamic proxy switching with pyppeteer

Installation

pip install async_rotating_proxy

Usage

from async_rotating_proxy import ProxyAPI
import pyppeteer

proxies = [
  ip:port,
  ip:port,
  ip:port
]

with ProxyAPI(proxies) as api:
  url = api.format_url("http://checkip.dyndns.org")

  browser = await pyppeteer.launch()
  page = await browser.newPage()
  await page.goto(url)

Purpose

The article referenced below sums it up pretty well: "The chrome browser does not support fain-grained proxy configuration out of the box. Therefore, the following use cases are not possible when using puppeteer in combination with Google Chrome:

Using different proxies for different tabs/windows
Switching proxies without restarting the browser

This is a bit annoying, because restarting the entire browser is an expensive operation in terms of computational resources. The chrome restart takes up to two seconds (depending on the system). We ideally want to switch proxies whenever the need arises without restarting the entire chrome process. This is a common requirement when scraping websites in scale."

Reference

https://incolumitas.com/2020/12/20/dynamically-changing-puppeteer-proxies/

Project details


Download files

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

Source Distribution

async_rotating_proxy-0.0.6.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

async_rotating_proxy-0.0.6-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file async_rotating_proxy-0.0.6.tar.gz.

File metadata

  • Download URL: async_rotating_proxy-0.0.6.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for async_rotating_proxy-0.0.6.tar.gz
Algorithm Hash digest
SHA256 30dcd391ce4a884a53321352a8e8258126432019ab54dc82bde0a3b6b49ef6de
MD5 beb1810c5d4b0109783c73777e483a2a
BLAKE2b-256 16199b3d92bd304e4a4b1815d143708bd76d3767068103b8019c0319a36930a0

See more details on using hashes here.

File details

Details for the file async_rotating_proxy-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for async_rotating_proxy-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b3f14cfa61c08b37adce84d1989d9780891d938e2b4d47ce881503551938a961
MD5 64c171c990dc134c5f19fc39b454e21b
BLAKE2b-256 e8742c2bfa1ed152f37616540be567b1b935f4cf8a854bc78e24e07239e827f4

See more details on using hashes here.

Supported by

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