Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests, time
- CONTINUE_AT = '01changer'
- with open('_all-pypi-packages.txt', encoding='utf-8') as fp:
- packages = [i.strip() for i in fp.readlines()]
- err = open('_errors.txt', 'a')
- for package in packages:
- if CONTINUE_AT is not None and package != CONTINUE_AT:
- continue
- else:
- CONTINUE_AT = None
- print('Downloading ' + package + '...')
- response = requests.get('https://pypi.org/project/' + package)
- if response.status_code != requests.codes.ok:
- print('Error downloading package ' + package)
- err.write(package + '\n')
- continue
- with open(package + '.html', 'w', encoding='utf-8') as fp:
- fp.write(response.text)
- time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement