إعداد البروكسي في Scrapy
Python crawling framework with its own downloader middleware stack. وجّهه إلى تجمّع Eveses السكني بالإعداد أدناه — الموقع الجغرافي يعيش داخل اسم المستخدم، فتغيير الدولة لا يتطلّب تعديل أي شيء آخر.
proxy.eveses.com:12321 · SOCKS5 على 32325 · 199 دولة · من $7.35/غيغابايت
Scrapy will not pick the proxy up from `http_proxy` for HTTPS targets. It has to go through `HttpProxyMiddleware`, and the credentials must be set on the request rather than in the URL — a proxy URL with a password in it is silently stripped from `meta["proxy"]`.
الإعداد
# settings.py
DOWNLOADER_MIDDLEWARES = {
"scrapy.downloadermiddlewares.httpproxy.HttpProxyMiddleware": 110,
"myproject.middlewares.EvesesProxyMiddleware": 100, # must run BEFORE 110
}
# middlewares.py
import base64
class EvesesProxyMiddleware:
USER = "eveses_user_country-us" # add geo tokens to the username
PASS = "YOUR_PROXY_PASSWORD"
def process_request(self, request, spider):
request.meta["proxy"] = "http://proxy.eveses.com:12321"
creds = base64.b64encode(f"{self.USER}:{self.PASS}".encode()).decode()
request.headers["Proxy-Authorization"] = f"Basic {creds}"ملاحظات حول Scrapy
Give the middleware a lower number than HttpProxyMiddleware (110) so it sets `meta["proxy"]` first.
Rotate per request by appending a fresh `_session-…` token to the username inside `process_request`.
Leave `RETRY_TIMES` at its default; a blocked exit IP retries onto a different one automatically.
غيّر الدولة دون المساس بـScrapy
eveses_user_country-deeveses_user_country-de_session-ab12cd34_lifetime-30mالموقع والجلسة يعيشان في اسم المستخدم، لا في المضيف أو المنفذ. كل إعداد في هذه الصفحة يبقى كما هو عند تغيير الدولة — تعدّل سلسلة واحدة فقط. 199 دولة قابلة للاستهداف، ومعظمها يقبل رموز المدينة والمنطقة.
الأسئلة الشائعة
كيف أضبط بروكسي في Scrapy؟›
كيف أختار الدولة التي يخرج منها Scrapy؟›
كيف أحتفظ بالعنوان نفسه بين الطلبات في Scrapy؟›
كم يكلّف هذا؟›
تكاملات أخرى
شغّل Scrapy عبر عناوين سكنية
$7.35/غيغابايت عند 1 غيغابايت، و$2.57/غيغابايت بالجملة — نفس بيانات الدخول في كل أداة.
احصل على بروكسيات ←