import requests
import time
defdownload_one(url):
resp = requests.get(url)print('Read {} from {}'.format(len(resp.content), url))defdownload_all(sites):for site in sites:
download_one(site)defmain():
start_time = time.perf_counter()
download_all(sites)
end_time = time.perf_counter()print('Download {} sites in {} seconds'.format(len(sites), end_time - start_time))if __name__ =='__main__':
main()
Read 190716 from https://www.tutorialspoint.com/python/index.htm
Read 360091 from https://www.w3schools.com/python/default.asp
Read 135028 from https://realpython.com/tutorials/python/
Read 79647 from https://www.programiz.com/python-programming/tutorial
Read 3082 from https://pythonbasics.org/learn-python/
Read 31649 from https://www.learnpython.org/
Read 15536 from https://www.datacamp.com/community/tutorials/python-data-science-handbook
Read 604652 from https://www.codecademy.com/learn/learn-python
Read 26062 from https://python-course.eu/python3_tutorial