Scrapy proxy integation

Scrapy Proxy Integration

What is Scrapy?

Scrapy is a Python framework for web crawling and scraping, which allows users to extract structured data from websites. It is open-source, fast, and extensible. Scrapy can be used for various purposes, such as data mining, monitoring, and automated testing.

Scrapy integration with Bright Data proxies

Open your preferred IDE and start a new scrapy project, type in the command line :

      scrapy startproject <project_name>
    

This will create a new folder with the project name, within the folder open a python file.

  • Go to your Bright Data Control Panel and clicking the ‘Proxies & Scraping Infra’ icon
  • Create a new proxy zone by clicking ‘Add’, choosing a network type, configuring the proxy, and clicking save
  • Under your proxy-zone’s ‘Access parameters’ tab, you will find your ‘USERNAME’ and ‘PASSWORD’ values.
  • In your scrapy spider code file, within the request’s meta parameter set the ‘proxy’ value to be the following, using the ‘USERNAME’ and ‘PASSWORD’ values from before: “http://USERNAME:[email protected]:33335
  • For Example:
      import scrapy

class BrightdatascrapyexampleSpider(scrapy.Spider):
name = "BrightDataScrapyExample"

def start_requests(self):
request = scrapy.Request(url="http://example.com",callback=self.parse)
request.meta['proxy'] = "http://USERNAME:[email protected]:33335"
yield request

def parse(self, response):
print(response.body)

Then run the following command in your command line :

      scrapy runspider <Pythonfilename.py>
    

How To Use Bright Data Proxy Manger With Scrapy

  • Create a proxy zone same as in the direct integration above
  • Install the Proxy Manager
  • Click ‘add new port’ and configure it for your use case
  • In your Scrapy spider code file, within the request’s meta parameter set the ‘proxy’ value to be the following: “http://IP:PORTNUMBER”
  • The local host IP is 127.0.0.1 – this is the value you need to use if the proxy manager is installed on your machine. If the proxy manager is installed on an external server, input that server’s IP address
  • The port created in the Proxy Manager is 24XXX, for example, 24000 – the default first port number
  • For example:
      import scrapy

class BrightdatascrapyexampleSpider(scrapy.Spider):
name = "BrightDataScrapyExample"

def start_requests(self):
request = scrapy.Request(url="http://example.com",callback=self.parse)
request.meta['proxy'] = "http://127.0.0.1:24000"
yield request

def parse(self, response):
print(response.body)

⚠️Important note: If you are using Bright Data’s Residential Proxies, Web Unlocker or SERP API, you need to install an SSL certificate to enable end-to-end secure connections to your target website(s). This is a simple process, see https://docs.brightdata.com/general/account/ssl-certificate#installation-of-the-ssl-certificate for instructions.

Get proxies for Scrapy

proxy badges

Powered by an award-winning proxy infrastructure

Over 72 million residential IPs, best-in-class technology and the ability to target any country, city, ZIP Code, carrier, & ASN make our premium proxy services a top choice for developers.

About Bright Data proxies

Residential Proxies

  • 72,000,000+ IPs
  • Available in 195 countries
  • The largest rotating real-peer IP network
  • Access & crawl all sophisticated websites

Datacenter Proxies

  • 770,000+ IPs
  • Available in 98 countries
  • Shared and dedicated IP pools available
  • Access & crawl all sophisticated websites

ISP Proxies

  • 700,000+ IPs
  • Available in 35 countries
  • Real static residential IPs without IP rotation
  • Best for logging into multiple accounts

Mobile Proxies

  • 7,000,000+ IPs
  • Available in 195 countries
  • Largest real-peer 3G/4G IP network
  • Verify mobile ads & crawl mobile sites

Proxy Network Pricing

PAY AS YOU GO
$8.4 / GB
No commitment
Start free trial
Use our proxies without monthly commitment
69 GB Included
$7.14 / GB
$499 Billed monthly
Start free trial
Perfect for small businesses with moderate usage
158 GB Included
$6.3 / GB
$999 Billed monthly
Start free trial
Designed for large teams with extensive operational needs
339 GB Included
$5.88 / GB
$1999 Billed monthly
Start free trial
Optimized for enterprises running large-scale operations
Need more than 1 TB?
Contact us
  • Unlimited scale
  • Unlimited seats
  • Premium SLA
  • 99.99% Network Uptime
  • Free Proxy Manager
  • Complete data coverage
  • Custom price per GB
  • Custom solutions
PAY AS YOU GO
$8.4 / GB
No commitment
Start free trial
Use our proxies without monthly commitment
69 GB Included
$7.14 / GB
$499 Billed monthly
Start free trial
Perfect for small businesses with moderate usage
158 GB Included
$6.3 / GB
$999 Billed monthly
Start free trial
Designed for large teams with extensive operational needs
339 GB Included
$5.88 / GB
$1999 Billed monthly
Start free trial
Optimized for enterprises running large-scale operations
Need more than 1 TB?
Contact us
  • Unlimited scale
  • Unlimited seats
  • Premium SLA
  • 99.99% Network Uptime
  • Free Proxy Manager
  • Complete data coverage
  • Custom price per GB
  • Custom solutions
PAY AS YOU GO
$15 / GB
No commitment
Start free trial
Use our proxies without monthly commitment
39 GB Included
$12.75 / GB
$499 Billed monthly
Start free trial
Perfect for small businesses with moderate usage
88 GB Included
$11.25 / GB
$999 Billed monthly
Start free trial
Designed for large teams with extensive operational needs
190 GB Included
$10.5 / GB
$1999 Billed monthly
Start free trial
Optimized for enterprises running large-scale operations
Need more than 1 TB?
Contact us
  • Unlimited scale
  • Unlimited seats
  • Premium SLA
  • 99.99% Network Uptime
  • Free Proxy Manager
  • Complete data coverage
  • Custom price per GB
  • Custom solutions
PAY AS YOU GO
$0.6 / GB
No commitment
Start free trial
Use our proxies without monthly commitment
1 TB Included
$0.51 / GB
$499 Billed monthly
Start free trial
Perfect for small businesses with moderate usage
2 TB Included
$0.45 / GB
$999 Billed monthly
Start free trial
Designed for large teams with extensive operational needs
5 TB Included
$0.42 / GB
$1999 Billed monthly
Start free trial
Optimized for enterprises running large-scale operations
Need more than 1 TB?
Contact us
  • Unlimited scale
  • Unlimited seats
  • Premium SLA
  • 99.99% Network Uptime
  • Free Proxy Manager
  • Complete data coverage
  • Custom price per GB
  • Custom solutions
We accept these payment methods:

The best customer experience in the industry

You ask, we develop

New feature releases every day

24/7 global support

To answer any questions right when you need it

Full transparency

Real-time network performance dashboard

Dedicated Account Managers

To optimize your performance

Tailored solutions

To meet your data collection goals

The category leader in proxies and data collection

Category leader in proxies

650TB of public data collected every day

Number of ISP proxies

New feature releases every day

Serving 7/10 universities

Serving 7/10 of the world’s leading universities

Trust pilot ratings
4.6/5 Trustpilot rating

Ready to get Scrapy proxies?