开发者

urllib and proxies

开发者 https://www.devze.com 2022-12-30 09:24 出处:网络
I need in using Tor+Privoxy with my python-script. proxies = { \'http\': \'127.0.0.1:8118\', \'ssl\': \'127.0.0.1:8118\',

I need in using Tor+Privoxy with my python-script.

proxies = {
    'http'  : '127.0.0.1:8118',
    'ssl'   : '127.0.0.1:8118',
    'socks' : '127.0.0.1:9050'
}

The first question: is the 'socks' name right? Maybe there should be something like 'socks5'? The next step is that I should pass user-agent string with this proxies to the urllib and save information from loaded site into .html file. I don't know how to pass headers information w开发者_如何学运维ith proxies.


I suggest you use urllib2 instead. This post might be useful. hope it helps


not sure whether urllib is able to deal with socks proxy.. you may try socksipy

0

精彩评论

暂无评论...
验证码 换一张
取 消