Code Monkey home page Code Monkey logo

getproxyip's Introduction

代理IP抓取

原理说明

通过在网络上爬取公开的代理ip,同时在本地进行代理测试,提取可用的代理IP,并记录其网络延时,最后将结果保存到文件以及redis zset(可选).

代理IP分为三个匿名等级:高匿, 普匿, 透明; 程序中以3, 2, 1标记, 0:未知.

使用方法

新建python虚拟环境

$ virtualenv ~/virtualenv/ipproxy
$ source ~/virtualenv/ipproxy/bin/activate
$ pip install -r requirements.txt

修改配置文件 etc/config.py

$ mv etc/config.sample.py etc/config.py
$ vim etc/config.py
SNIFFER = {
    'PROCESS_NUM': 4,                   # 开启进程数
    'THREAD_NUM': 500,                  # gevent线程数
    'PROXY_TYPE': [0, 1, 2, 3],         # 指定代理IP匿名程度
    'TARGET': 'http://www.baidu.com',   # 测试代理IP的目标
    'TIMEOUT': 10,                      # 测试延时
    'OUTPUT': True,                     # 是否将结果输出到文件(`data/`)
    'BACKEND': 'localhost:6379',        # 是否将结果保存到redis(不保存则为'')
    'KEY_PREFIX': 'ipproxy:',           # redis key前缀
}

LOGGER = {
    "PATH": './ipproxy.log'             # 程序日志
}

启动脚本

$python main.py

调用方法(redis zset)

参考 `example`

数据源

每日更新

实时更新

getproxyip's People

Watchers

wyx avatar

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.