title: how do I move on to the next proxy without using a proxy another thread has used? Python
body: <p>I'm trying to run a python program that involves threads and a proxy list but not all these proxies might work. If a proxy failure happens how do I move on to the next proxy without using a proxy another thread has used?</p>
  <p>My code:</p>
  <pre><code>from threading import Thread 
  from selenium import webdriver
  from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
  
  def run_session(accounts,proxy):
      
      firefox_capabilities = webdriver.DesiredCapabilities.FIREFOX
      firefox_capabilities['proxy'] = {
          &quot;proxyType&quot;: &quot;MANUAL&quot;,
          &quot;httpProxy&quot;: proxy,
          &quot;sslProxy&quot;: proxy
      }
  
      driver = webdriver.Firefox(capabilities=firefox_capabilities)
  
      driver.get('example')
  
  accounts = [
      {
      'test_name':'Test_1',
      'name':'NA',
      },
      {
      'test_name':'Test_2',
      'name':'NA',
      },
      {
      'test_name':'Test_3',
      'name':'NA',
      }]
  
  perfect_proxies_list = [62.205.169.74:53281,66.94.97.238:443,178.217.172.206:55443,171.97.54.242:55443,119.76.142.153:8080]
  
  for act, proxy in zip(accounts, perfect_proxies_list):
      Thread(target=run_session, args=(act,proxy)).start()
  </code></pre>