title: Selenium & Heroku: urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
body: <p>Setup:</p>
  
  <ul>
  <li><strong>selenium</strong>: 3.141.0</li>
  <li><strong>python</strong>: 3.6.7</li>
  <li><strong>heroku-stack</strong>: heroku-18 </li>
  <li><strong>headless-chrome</strong>: v71.0.3578.80 buildpack installed  </li>
  <li><strong>chromedriver</strong>: v2.44.609551 buildpack installed</li>
  </ul>
  
  <p>I'm getting this error when using selenium in heroku:</p>
  
  <pre><code>urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
  </code></pre>
  
  <p>I googled but didn't have luck. The error happens at the last line of this code.</p>
  
  <hr>
  
  <h2><strong>Code</strong></h2>
  
  <pre><code>from selenium import webdriver
  from selenium.common.exceptions import TimeoutException
  from selenium.webdriver.support.wait import WebDriverWait
  from selenium.webdriver.support import expected_conditions as EC
  from selenium.webdriver.common.by import By
  
  UA = 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36' \
       '(KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'
  DRIVER_PATH = '/app/.chromedriver/bin/chromedriver'
  
  chrome_options = webdriver.ChromeOptions()
  chrome_options.binary_location = '/app/.apt/usr/bin/google-chrome'
  chrome_options.add_argument(f'--user-agent={UA}')
  chrome_options.add_argument(f'--proxy-server=http://my_private_proxy.com:my_port')
  chrome_options.add_argument('--disable-gpu')
  chrome_options.add_argument('--no-sandbox')
  
  chrome = webdriver.Chrome(executable_path=DRIVER_PATH, options=options)
  </code></pre>