title: Python Selenium shows OS Error
body: <p>I have run the following code and expected that it will open new URL(google home page) in a new tab whenever it meets condition (have to open new google page URL), but its running fine for sometime then its thrown an exception.</p>
  
  <p>Here it's my code.</p>
  
  <pre><code>from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  import time
  import socket
  from datetime import datetime
  
  try:
  
  
      options =webdriver.ChromeOptions()
      options.add_argument('--ignore-certificate-errors')
      options.add_argument('--ignore-ssl-errors')
      driver = webdriver.Chrome(chrome_options=options, executable_path ="C:/Users/gsssaaaa/Desktop/Python/exe.win-amd643.6/selenium/chromedriver.exe",port=80)
  
      driver.get('file:///C:/Users/gsssaaaa/AppData/Local/Temp/Temp1_site.zip/site/index.html')
  
      time.sleep(30)
  
      ticketopened = False
      while True:
  
          if driver.find_element_by_class_name('custom-select').text == "Ready":
              time.sleep(0.5)
  
              if driver.find_element_by_class_name('custom-select').text == "Talking":
                  if ticketopened == False:
  
                      window = 0
                      driver.execute_script("$(window.open('https://www.google.com'))")
                      driver.switch_to_window(driver.window_handles[window])
                      window = window + 1
  
                      ticketopened = True
                      continue
                  else:
                      ticketopened = False
              else:
                  continue
          else:
              continue
  
  except Exception as e:
      print('Exception Occured: ',e)
      print('Time and Date: '+str(datetime.now())[0:19])
  </code></pre>
  
  <p>Here is my error message:</p>
  
  <blockquote>
    <p>OSError: [WinError 10048] Only one usage of each socket address
    (protocol/network  address/port) is normally permitted</p>
  </blockquote>
  
  <p>I am not really aware of ports. If it's regarding port issue, then could you please tell me how to use ports in python and where to use it in my code to avoid this exception.</p>
  
  <p>Can you help me on this?</p>