multithreaded crawler while using tor proxy
问题 I am trying to build multi threaded crawler that uses tor proxies: I am using following to establish tor connection: from stem import Signal from stem.control import Controller controller = Controller.from_port(port=9151) def connectTor(): socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9150) socket.socket = socks.socksocket def renew_tor(): global request_headers request_headers = { "Accept-Language": "en-US,en;q=0.5", "User-Agent": random.choice(BROWSERS), "Accept": "text/html