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 16
16
import os
17
17
import platform
18
18
import requests
19
- import urllib3 # Some systems don't have requests.packages.urllib3
20
19
import shutil
21
20
import sys
22
21
import tarfile
23
22
import zipfile
24
23
from seleniumbase import drivers # webdriver storage folder for SeleniumBase
25
- urllib3 .disable_warnings ()
26
24
DRIVER_DIR = os .path .dirname (os .path .realpath (drivers .__file__ ))
27
25
28
26
@@ -186,13 +184,11 @@ def main():
186
184
file_path = downloads_folder + '/' + file_name
187
185
if not os .path .exists (downloads_folder ):
188
186
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
+
192
188
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 )
196
192
print ('Download Complete!\n ' )
197
193
198
194
if file_name .endswith (".zip" ):
You can’t perform that action at this time.
0 commit comments