دنبال کننده ها

۱۳۹۶ شهریور ۱۱, شنبه

Scrapy : How to write a HttpProxyMiddleware?

[ad_1]


This middleware sets the HTTP proxy to use for requests, by setting the proxy meta value for Request objects.



Like the Python standard library modules urllib and urllib2, it obeys the following environment variables:



http_proxy
https_proxy
no_proxy


You can also set the meta key proxy per-request, to a value like http://some_proxy_server:port or http://username:password@some_proxy_server:port. Keep in mind this value will take precedence over http_proxy/https_proxy environment variables, and it will also ignore no_proxy environment variable.


But there are no examples in the docs.
I have no ideas how to write a HttpProxyMiddleware.
Are there any suggestions?



[ad_2]

لینک منبع