Python feapder & ScrapySplash Tunnel Proxy: Framework Extensions

feapder AirSpider and Scrapy+Splash integrating 16Yun Crawler Proxy.

16Yun Engineering TeamMay 11, 20261 min read

feapder: Lightweight Crawler Framework

feapder is a lightweight Python crawler framework, configuring proxies via the download_midware method.

import os, feapder
 
class DemoSpider(feapder.AirSpider):
    def start_requests(self):
        yield feapder.Request("https://httpbin.org/ip")
 
    def download_midware(self, request):
        host = os.getenv("PROXY_HOST", "t.16yun.cn")
        port = os.getenv("PROXY_PORT", "31111")
        user = os.getenv("PROXY_USERNAME", "user")
        pwd = os.getenv("PROXY_PASSWORD", "password")
        request.proxies = {
            "http": f"http://{user}:{pwd}@{host}:{port}",
            "https": f"http://{user}:{pwd}@{host}:{port}",
        }
        return request
 
    def parse(self, request, response):
        print(response.text)
 
if __name__ == "__main__":
    DemoSpider().start()
Scenariofeapder Implementation
A: Force Switchfeapder creates new connection per request by default
B: Keep IPReuse AirSpider instance (default)
C: Proxy-TunnelAdd Proxy-Tunnel via request.headers

ScrapySplash: JS-rendered Scraping

ScrapySplash renders JS via Splash and returns HTML. Proxy configuration is on the Splash side:

# settings.py
SPLASH_URL = "http://splash:8050"
 
SPLASH_PROXY = {
    "host": os.getenv("PROXY_HOST", "t.16yun.cn"),
    "port": int(os.getenv("PROXY_PORT", "31111")),
    "username": os.getenv("PROXY_USERNAME", "user"),
    "password": os.getenv("PROXY_PASSWORD", "password"),
}
 
DOWNLOADER_MIDDLEWARES = {
    "scrapy_splash.SplashDeduplicateArgsMiddleware": 100,
}
 
DUPEFILTER_CLASS = "scrapy_splash.SplashAwareDupeFilter"

Splash acts as an intermediate proxy layer, receiving browser rendering requests and forwarding to the crawler proxy:

Scrapy → Splash (JS rendering) → 16Yun Crawler Proxy → Target site

Use Case Comparison

FrameworkUse CaseProxy Configuration
feapderLightweight, rapid developmentdownload_midware injection
ScrapySplashPages requiring JS renderingConfigure upstream proxy on Splash side

Need an enterprise proxy plan?

We can tailor architecture to your target domains, concurrency, and reliability goals.