If you’re cool with Tor, this script’s worked for me:
```python
from stem import Signal
from stem.control import Controller
with Controller.from_port(port=9051) as c:
c.authenticate()
c.signal(Signal.NEWNYM)
```
Might not be 3 sec every time, but it’s close.
Just make sure Tor’s running in the background.
```python
from stem import Signal
from stem.control import Controller
with Controller.from_port(port=9051) as c:
c.authenticate()
c.signal(Signal.NEWNYM)
```
Might not be 3 sec every time, but it’s close.
Just make sure Tor’s running in the background.
