
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
scrapy-crawlbase-middleware
Advanced tools
Scrapy Crawlbase Proxy Middleware: Crawlbase interfacing middleware for Scrapy
Processes Scrapy requests using Crawlbase services either with Normal or Javascript tokens
Choose a way of installing:
python setup.py install
pip install scrapy-crawlbase-middleware
Then in your Scrapy settings.py
add the following lines:
# Activate the middleware
CRAWLBASE_ENABLED = True
# The Crawlbase API token you wish to use, either normal of javascript token
CRAWLBASE_TOKEN = 'your token'
# Enable the middleware
DOWNLOADER_MIDDLEWARES = {
'scrapy_crawlbase.CrawlbaseMiddleware': 610
}
Use the scrapy_crawlbase.CrawlbaseRequest instead of the scrapy built-in Request. The scrapy_crawlbase.CrawlbaseRequest accepts additional arguments, used in Proxy Crawl API:
from scrapy_crawlbase import CrawlbaseRequest
class ExampleScraper(Spider):
def start_requests(self):
yield CrawlbaseRequest(
"http://target-url",
callback=self.parse_result
device='desktop',
country='US',
page_wait=1000,
ajax_wait=True,
dont_filter=True
)
The target url will be replaced with proxy crawl url and parameters will be encoded into the url by the middleware automatically.
If you have questions or need help using the library, please open an issue or contact us.
Copyright 2023 Crawlbase
FAQs
Scrapy Crawlbase Proxy Middleware: Crawlbase interfacing middleware for Scrapy
We found that scrapy-crawlbase-middleware demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.