Scrapy proxy integation

Scrapy Proxy Integration

This guide may be outdated. For an up-to-date guide please see our documentation.

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

受賞歴のあるプロキシネットワークを搭載

72百万以上の住宅用IPアドレス、クラス最高のテクノロジー とターゲットにする能力 国、都市、運送業者、ASN プレミアムプロキシサービスを開発者にとって最高の選択肢にします

Proxy Network Pricing

50%オフ
pay as you go plan icon
従量課金プラン
$8 $4.00 / GB
月額固定料金なし
無料トライアル
このクーポンコードを使用してください: RESIGB50

当社のプロキシを月額固定料金なしでご利用いただけます。
50%オフ
2nd plan icon
141 GB分無料
$7 $3.50 / GB
$499 / 月
無料トライアル
このクーポンコードを使用してください: RESIGB50

使用量が中程度の小規模ビジネスに最適
50%オフ
3rd plan icon
332 GB分無料
$6 $3.00 / GB
$999 / 月
無料トライアル
このクーポンコードを使用してください: RESIGB50

幅広い運用ニーズのある大規模チーム向けに設計
50%オフ
4th plan icon
798 GB分無料
$5 $2.50 / GB
$1999 / 月
無料トライアル
このクーポンコードを使用してください: RESIGB50

大規模な運営を管理する企業向けに最適化
1TB 以上必要ですか?
お問い合わせ
  • 無制限のスケール
  • 座席無制限
  • プレミアムSLA
  • ネットワークの稼働時間99.99%
  • 無料のプロキシマネージャー
  • データの完全なカバレッジ
  • 1GBあたりのカスタム価格
  • カスタムソリューション
pay as you go plan icon
従量課金プラン
$8 / GB
月額固定料金なし
無料トライアル
当社のプロキシを月額固定料金なしでご利用いただけます。
2nd plan icon
71 GB分無料
$7 / GB
$499 / 月
無料トライアル
使用量が中程度の小規模ビジネスに最適
3rd plan icon
166 GB分無料
$6 / GB
$999 / 月
無料トライアル
幅広い運用ニーズのある大規模チーム向けに設計
4th plan icon
399 GB分無料
$5 / GB
$1999 / 月
無料トライアル
大規模な運営を管理する企業向けに最適化
1TB 以上必要ですか?
お問い合わせ
  • 無制限のスケール
  • 座席無制限
  • プレミアムSLA
  • ネットワークの稼働時間99.99%
  • 無料のプロキシマネージャー
  • データの完全なカバレッジ
  • 1GBあたりのカスタム価格
  • カスタムソリューション
pay as you go plan icon
従量課金プラン
$0.6 / GB
月額固定料金なし
無料トライアル
当社のプロキシを月額固定料金なしでご利用いただけます。
2nd plan icon
1 TB含む
$0.51 / GB
$499 / 月
無料トライアル
使用量が中程度の小規模ビジネスに最適
3rd plan icon
2 TB含む
$0.45 / GB
$999 / 月
無料トライアル
幅広い運用ニーズのある大規模チーム向けに設計
4th plan icon
5 TB含む
$0.42 / GB
$1999 / 月
無料トライアル
大規模な運営を管理する企業向けに最適化
1TB 以上必要ですか?
お問い合わせ
  • 無制限のスケール
  • 座席無制限
  • プレミアムSLA
  • ネットワークの稼働時間99.99%
  • 無料のプロキシマネージャー
  • データの完全なカバレッジ
  • 1GBあたりのカスタム価格
  • カスタムソリューション
これらの支払い方法を受け付けています:

業界No.1のカスタマーエクスペリエンス

どんなニーズにも対応

毎日新機能をリリース

年中無休グローバルサポート

必要な時にサポートします

完全な透明性

リアルタイムのネットワークパフォーマンス ダッシュボード

専任のアカウント
マネージャー

パフォーマンス最適化のサポート

ニーズに合わせたご提案

お客様のデータ収集目標を満たします

プロキシとデータ収集の分野における業界トップ

毎日650TBの公共データが収集されている

毎日新機能をリリース

世界有数の大学10校のうち7校にサービスを提供

4.6/5トラストパイロット評価

Ready to get Scrapy proxies?