File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
seleniumbase/console_scripts Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change 1616import os
1717import platform
1818import requests
19- import urllib3 # Some systems don't have requests.packages.urllib3
2019import shutil
2120import sys
2221import tarfile
2322import zipfile
2423from seleniumbase import drivers # webdriver storage folder for SeleniumBase
25- urllib3 .disable_warnings ()
2624DRIVER_DIR = os .path .dirname (os .path .realpath (drivers .__file__ ))
2725
2826
@@ -186,13 +184,11 @@ def main():
186184 file_path = downloads_folder + '/' + file_name
187185 if not os .path .exists (downloads_folder ):
188186 os .mkdir (downloads_folder )
189- local_file = open (file_path , 'wb' )
190- http = urllib3 .PoolManager ()
191- remote_file = http .request ('GET' , download_url , preload_content = False )
187+
192188 print ('\n Downloading %s from:\n %s ...' % (file_name , download_url ))
193- local_file . write ( remote_file . read () )
194- local_file . close ()
195- remote_file . close ( )
189+ remote_file = requests . get ( download_url )
190+ with open ( file_path , 'wb' ) as file :
191+ file . write ( remote_file . content )
196192 print ('Download Complete!\n ' )
197193
198194 if file_name .endswith (".zip" ):
You can’t perform that action at this time.
0 commit comments