Scrapy ProxyCrawl Proxy Middleware: ProxyCrawl interfacing middleware for Scrapy
Project description
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
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
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
Built Distributions
Hashes for scrapy-proxycrawl-middleware-1.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 156a8c61e4d881df3f382c28117567e4668c81378b73d92d76ef5efb7fd0e06f |
|
MD5 | 05753f6af5ad138a262c58d8e6513486 |
|
BLAKE2b-256 | 8c740b70ab4209a263a966035b5fab571d2f732bf85d32d5bf9c064370797917 |
Hashes for scrapy_proxycrawl_middleware-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22b3c6a7eaf5293c7464b1d8ced6cc0cfe968fa6c89984d926d4f884cafab481 |
|
MD5 | f12902f7ca25b70f56bf806b7206dce5 |
|
BLAKE2b-256 | 6e1fe8a0a931d4a1e8d2fc96ac78c88de3dcacc1a69f265feadc9d3cc934243f |
Hashes for scrapy_proxycrawl_middleware-1.1.0-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d1461044197456cab54b0e7d5cd0dbd38419710d6e657439510bc7810d9fb40 |
|
MD5 | ed37a55c15bd0d974e0c0e00ad73ef9b |
|
BLAKE2b-256 | 1ebee0738f10157b8a391d0787bbc8ec37de404b92518d521a6582b503aab9c0 |