This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from adder import add | |
z = add(4.0, 6.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
wait_time = 2 | |
number_of_ip_rotations = 3 | |
tor_handler = TorHandler() | |
ip = tor_handler.open_url('http://icanhazip.com/') | |
print('My first IP: {}'.format(ip)) | |
# Cycle through the specified number of IP addresses via TOR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from urllib.request import ProxyHandler, build_opener, install_opener, Request, urlopen | |
from stem import Signal | |
from stem.control import Controller | |
class TorHandler: | |
def __init__(self): | |
self.headers = { | |
'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7'} |
OlderNewer