Scrapy Proxy Middleware

A quick guide to setup proxies on Scrapy Proxy Middleware.

  1. Open Terminal window.

  2. Navigate to the main directory of your project folder using: cd yourprojectname

  3. Download our proxy middleware using the following command:

curl >
Scrapy proxy middleware downloadScrapy proxy middleware download

Scrapy proxy middleware download

  1. You should now see that your Project Folder is filled with the file.

  2. Using a File Manager, navigate to your Project Folder, where you should see the  file which is located at the bottom of the directory.

  3. Edit the file using an editor of your choice.

Scrapy proxy middleware edit settings.pyScrapy proxy middleware edit

Scrapy proxy middleware edit

  1. Add the following properties at the bottom:
    'scrapy.downloadermiddlewares.httpproxy.HttpProxyMiddleware': 110,
    'yourprojectname.smartproxy_auth.ProxyMiddleware': 100,

SMARTPROXY_USER = 'username' ## Smartproxy Username (Sub-user)
SMARTPROXY_PASSWORD = 'password' ## Password for your user
SMARTPROXY_ENDPOINT = '' ## Endpoint you'd like to use
SMARTPROXY_PORT = '7000' ## Port of the endpoint you are using.
Scrapy proxy middleware proxy settingsScrapy proxy middleware proxy settings

Scrapy proxy middleware proxy settings

  1. In the DOWNLOADER_MIDDLEWARES change yourprojectname line to the name of your project.
Scrapy proxy middleware change project nameScrapy proxy middleware change project name

Scrapy proxy middleware change project name

  1. Make sure that you enter your account details as well as proxy details within punctuation marks ('').

  2. Save the file.


To find more information about the setup, make sure to visit our Github Page. In case you wish to use Smartproxy directly in your request, please refer to this article instead.