S
S
SKEPTIC2019-07-21 14:17:31
proxy
SKEPTIC, 2019-07-21 14:17:31

Tor as a proxy?

There is a parser, for which I want to use tor addresses as a proxy.
I came across a solution on the Internet: launch the tor browser on your PC and specify localhost:9150 as a proxy.
But here's the problem: how to connect directly to tor addresses, and not through the tor browser. And you need to be able to simultaneously connect to dozens of addresses from the tor network and use them as a proxy server.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Yakushenko, 2019-07-21
@pro100chel

There are 2 options for using the Tor network, both involve using authorization.
1. Using a bunch of random_user:password . In this case, a new IP address is issued for each user during authorization. Those. with each requests request, you will receive a new IP.

proxy_auth = str(random.randint(10000, 2147483647)) + ':' + 'passwrd'
proxies = {'http': 'socks5h://{}@localhost:9050'.format(proxy_auth), 'https': 'socks5h://{}@localhost:9050'.format(proxy_auth)}
response = requests.get(url, proxies=proxies)

2. Use user:random_password . In this case, you can create an IP for the "user" and use this IP address again.
proxy_auth = 'user' + ':' + str(random.randint(10000, 2147483647))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question