Answer the question
In order to leave comments, you need to log in
How to connect to TOR in python?
There is a script that, through a free proxy in multi-threaded mode, collects data through accounts on one site.
Because it seems to me that socks alone are not enough for high anonymity, I decided to add tor (socks-> tor-> socks).
Question:
How to work with Tor in python? Can this be done without using an external client? It's just that I often work on different machines and carry programs on a flash drive, i.e. installing Tor every time on a new machine will not be very convenient.
Answer the question
In order to leave comments, you need to log in
#!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
import requests
proxies = {
'http': 'socks5://localhost:9050',
'https': 'socks5://localhost:9050'
}
url = 'http://icanhazip.com/'
out = requests.get(url, proxies=proxies).text
out = (out.replace('\n',''))
print (out)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question