In [1]:
import sys
import os
import requests
#sys.path.append("~/Dropbox/mondayProjects/tor_scraper/tor_control.py")
from tor_control import TorControl

In [2]:
tc = TorControl()


TOR CONTROLLER
Make sure that Tor is active in port 9050 and the Controller is active in port 9051
to activate uncomment lines ControlPort and HashedControlPassword from /etc/tor/torrc and restart tor

In [3]:
print(requests.get("https://api.ipify.org?format=jso").text)
tc.renew_tor()
print(requests.get("https://api.ipify.org?format=jso").text)


18.85.22.204
62.210.115.87

In [ ]: