You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

13 lines
337 B

import os
import requests
cwd = os.getcwd()
print('Current working directory is: ', cwd)
res = requests.get('https://automatetheboringstuff.com/files/rj.txt')
res.raise_for_status()
playFile = open(cwd + '\\web-scraping\\files\\RomeoAndJuli.txt', 'wb')
for chunk in res.iter_content(10000):
playFile.write(chunk)
playFile.close()