如何在dryscrape python中设置socks5代理? [英] How to set socks5 proxy in dryscrape python?

查看:61
本文介绍了如何在dryscrape python中设置socks5代理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过 Tor 废弃一些网站.

I want to scrap some website through tor.

Tor 使用socks 代理.我使用 dryscrape(python 中的库),因为它也执行 javascripts.

Tor works uses socks proxy. I use dryscrape(library in python) as it also executes javascripts as well.

但我dryscrape只能有http代理.

But I dryscrape can have only http proxy.

是否有一些工作可以为dryscrape设置socks5代理或任何其他出路?

Is there some work around to set socks5 proxy for dryscrape or any other way out?

谢谢.

推荐答案

我设法使用 polipo.它可以从这里安装在 ubuntu 上.

I managed to do it using polipo. It can be installed on ubuntu from here.

Polipo 可以讲socks 协议和http 协议.Polipo可以配置为通过http代理接收请求,通过socks5代理转发相同请求.

Polipo can speak socks protocol as well as http protocol. Polipo can be configured to receive requests through http proxy and forward the same requests through socks5 proxy.

我用它作为前端代理服务器来干刮,用于后端 Tor 代理服务器.

I used it as a front-end proxy server to dryscrape, for the back-end tor proxy server.

所以,现在我设置了 dryscrape 的 http 代理 127.0.0.1(机器 ip)和端口号.8118(polipo 的默认端口号).现在,Polipo 通过socks5 代理将相同的请求转发给tor.

So, now I set dryscrape's http proxy 127.0.0.1(machine ip) and port no. 8118(default port no. for polipo). Now, Polipo forwards the same request to tor through socks5 proxy.

所以,现在我可以使用dryscrape通过socks5代理发出请求.

So, now I can use dryscrape to make request through socks5 proxy.

这里有更详细的解释.;)

这篇关于如何在dryscrape python中设置socks5代理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆