Use curl instead urllib
import os
import sys
-try: # Python 3
- import urllib.request as urllib
-except ImportError: # Python 2
- import urllib
-
+import subprocess
pkg_version = os.environ['PKG_VERSION']
driver_version = "{0}.{1}".format(*pkg_version.split("."))
@@ -18,6 +14,4 @@ else:
download_url = 'https://chromedriver.storage.googleapis.com/{0}/{1}'.format(driver_version, chromedriver_pkg)
-resp = urllib.urlopen(download_url)
-with open('chromedriver.zip', 'wb') as zip_file:
- zip_file.write(resp.read())
+subprocess.call(['curl', download_url, '-o', 'chromedriver.zip'], shell=True)
