GithubHelp home page GithubHelp logo

lolotica123 / http-proxy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hd9319/http-proxy

0.0 0.0 0.0 7 KB

Making HTTP Requests with Proxy/User Agent Rotation

License: MIT License

Python 100.00%

http-proxy's Introduction

http-proxy

Extends the Python requests library by adding additional options for proxy/user agent rotation as well as tracking.

Prerequisites

  • Requires the requests library
  • Requires two .txt files: one which contains a list of webpages with proxies and the other with a list of user agents

Installing

  1. Create a virtual environment for your project and activate virtualenv -p python3 [projectname]

  2. Clone repository git clone https://github.com/hd9319/http-proxy

  3. Install dependencies using requirements.txt files pip install -r requirements.txt

How to Use

  1. Import ProxyRequest class into any project and use in place of requests library.
  2. Instantiate class and pass in parameters for retrieving list of user agents and proxies
  3. Refresh proxies before running any type of requests
  4. request() method returns a dictionary containing a response object, headers and proxy ip used for making the call.
from proxy import ProxyRequest

proxy_urls_path = 'C/.../*.txt'
user_agents_path = 'C/.../*.txt'

requests = ProxyRequest(proxy_urls_path, user_agents_path, timer=0)
               acceptable_status_codes=[200])
_ = requests.refresh_proxies()
response = requests.request(request, headers)

http-proxy's People

Contributors

hd9319 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.