Coder Social home page Coder Social logo

free-proxy's Introduction

Free-proxy

Get free working proxy from https://www.sslproxies.org/ and use it in your script

FreeProxy class scrapes proxies from https://www.sslproxies.org/ and checkes if proxy is working. There is posibility to
filter proxies by country and acceptable timeout. You can also randomize list of proxies from where script would get
first working proxy.

You can use it in sending request through custom proxy, with selenium or wherever you want.

Returns proxy as string:

'http://113.160.218.14:8888'

Requirements

  • Python3
  • Request library
  • Lxml library

Installation

pip install free-proxy

asciicast

Usage with examples

First import Free Proxy that way:

from fp.fp import FreeProxy

Options

Parameter Type Example Default value
country_id list ['US', 'BR'] None
timeout float > 0 0.1 0.5
rand bool True False
proxy = FreeProxy().get()
  • country_id parameter
    Get first working proxy from specified list of countries. If there is no valid proxy from specified list check all countries
proxy = FreeProxy(country_id=['US', 'BR']).get()
  • timeout parameter
    Timeout is parameter for checking if proxy is valid. If test site doesn't respond in specified time
    script marks this proxy as invalid. Default timeout=0.5. You can change it by defining
    specified timeout eg. timeout=1.
proxy = FreeProxt(timeout=1).get()
proxy = FreeProxy(rand=True).get()
  • anonym parameter
    Return only those proxies that are marked as anonymous. Defaults to anonym=False
proxy = FreeProxy(anonym=True).get()

You can combine parameters:

proxy = FreeProxy(country_id=['US', 'BR'], timeout=0.3, rand=True).get()

If there is no working proxy script returns None

CHANGELOG


[1.0.2] - 2020-09-03

  • Added anonym parameter

[1.0.1] - 2020-03-19

  • Fix typos in readme
  • Fix urrlib3 exception urllib3.exceptions.ProxySchemeUnknown: Not supported proxy scheme None,
  • Fix imports

[1.0.0] - 2019-02-04

  • Initial release

License


MIT

Free Software!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.