This code here gets a bunch of URLS from web archive.org and save them to a new TXT file. I want instead of INPUT (write one url address), to load a bunch of URLS from a TXT file. So x=input('URL:') must be replaced with some code to load each line at a time from a txt file.
I've been trying for few days now, i'm stuck! Please help!
The code:
x=input('Enter your url:-')
r = requests.get('http://web.archive.org/cdx/search/cdx?url=*.{}&output=text&fl=original&collapse=urlkey'.format(x))
with open('url.txt', 'a') as f:
f.write('\n')
f.writelines(str(r.text))
f.write('\n')