Giter VIP home page Giter VIP logo

scrapy-proxycrawl-middleware's Introduction

ProxyCrawl API middleware for Scrapy

Processes Scrapy requests using ProxyCrawl services either with Normal or Javascript tokens

Installing

Choose a way of installing:

  • Clone the repository inside your Scrapy project and run the following:
python setup.py install
  • Or use PyPi Python package manager. pip install scrapy-proxycrawl-middleware

Then in your Scrapy settings.py add the following lines:

# Activate the middleware
PROXYCRAWL_ENABLED = True

# The ProxyCrawl API token you wish to use, either normal of javascript token
PROXYCRAWL_TOKEN = 'your token'

# Enable the middleware
DOWNLOADER_MIDDLEWARES = {
    'scrapy_proxycrawl.ProxyCrawlMiddleware': 610
}

Usage

Use the scrapy_proxycrawl.ProxyCrawlRequest instead of the scrapy built-in Request. The scrapy_proxycrawl.ProxyCrawlRequest accepts additional arguments, used in Proxy Crawl API:

from scrapy_proxycrawl import ProxyCrawlRequest

class ExampleScraper(Spider):

    def start_requests(self):
        yield ProxyCrawlRequest(
            "http://target-url",
            callback=self.parse_result
            device='desktop',
            country='US',
            page_wait=1000,
            ajax_wait=True,
            dont_filter=True
        )

The target url will be replaced with proxy crawl url and parameters will be encoded into the url by the middleware automatically.

If you have questions or need help using the library, please open an issue or contact us.


Copyright 2020 ProxyCrawl

scrapy-proxycrawl-middleware's People

Contributors

crawlbase avatar fbergen avatar marianobrc avatar thiagola92 avatar

Watchers

 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.