Skip to content

Decodo/Scrapy-Middleware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

Main Repository

Disclaimer

If you're not familiar with Scrapy or how it works, we recommend researching the Scrapy documentation (https://docs.scrapy.org/en/latest/) to continue development with this tool.

Prerequisites

To get started with Scrapy, you will first need to install it using the methods provided in its documentation. Check here for more information

Installation

Once you get Scrapy up and running, if you have not yet, make sure that you create your project folder:

scrapy startproject yourprojectname

scrapy startproject anaconda prompt

When project directory is setup, you can deploy our 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 https://raw.githubusercontent.com/Decodo/Scrapy-Middleware/master/decodo_auth.py > decodo_auth.py
  4. You should now see your project folder populated with Decodo_auth.py file.

Configuration

To start using our middleware for proxy authentication, you'll need to configure settings for our proxy authentication.

Doing so is very simple:

  1. Using file manager, navigate to your project folder, you should see settings.py file located at the bottom of the directory.
  2. Edit the settings.py file using an editor of your choice and add the following properties at the bottom:
DOWNLOADER_MIDDLEWARES = {
    'scrapy.downloadermiddlewares.httpproxy.HttpProxyMiddleware': 110,
    'yourprojectname.decodo_auth.ProxyMiddleware': 100,
}

Decodo_USER = 'username' ## Decodo Username (Sub-user)
Decodo_PASSWORD = 'password' ## Password for your user
Decodo_ENDPOINT = 'gate.decodo.com' ## Endpoint you'd like to use
Decodo_PORT = '7000' ## Port of the endpoint you are using.

Decodo scrapy middleware http proxy configuration with username password authentication

  1. In DOWNLOADER_MIDDLEWARES change yourprojectname line to the name of your project.

  1. Make sure that you enter your account details as well as proxy details within quotation marks ('').
  2. Save the file.

Once all that is done, all of your spiders will be going through our proxies. If you are not sure how to set up a spider, take a look here

Need help?

Email - [email protected]
Live chat 24/7