Scrapy Middleware for proxy authentication with Smartproxy
:house: Main Repository :house:
In case you are not aware of what Scrapy is or how it works, we suggest researching Scrapy documentation in order to continue development with this tool.
To get started with Scrapy you will first need to install it using methods provided in their documentation. Check here for more information
Once you get Scrapy up and running if you have not yet, make sure that you create your project folder:
scrapy startproject yourprojectname
When project directory is setup, you can deploy our middleware:
cd yourprojectname
curl https://raw.githubusercontent.com/Smartproxy/Scrapy-Middleware/master/smartproxy_auth.py > smartproxy_auth.py
To start using our middleware for proxy authentication, you’ll need to configure settings for our proxy authentication.
Doing so is very simple:
SMARTPROXY_USER = ‘username’ ## Smartproxy Username (Sub-user)
SMARTPROXY_PASSWORD = ‘password’ ## Password for your user
SMARTPROXY_ENDPOINT = ‘gate.smartproxy.com’ ## Endpoint you’d like to use
SMARTPROXY_PORT = ‘7000’ ## Port of the endpoint you are using.
```
DOWNLOADER_MIDDLEWARES
change yourprojectname
line to the name of your project.Once all that is done, all of your spiders will be going through our proxies, if you are not sure how to setup a spider, take a look here