Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- input_file=input('filename input file with txt: ')
- output_file=input('output filename with txt: ')
- good=[]
- s=requests.Session()
- headers={
- 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; rv:61.0) Gecko/20100101 Firefox/61.0',
- 'Accept': '*/*',
- 'Accept-Language':'ru-RU,ru;q=0.8,en-US'
- }
- #
- with open(input_file, 'r') as f:
- for i in f:
- i=i.replace('\n', '')
- try:
- r=s.get('https://duckduckgo.com', headers=headers, proxies={'http://'+i, 'https://'+i})
- good.append(i)
- print(r)
- except:
- print(i+' bad')
- with open(output_file, 'a') as f:
- for i in good:
- f.write(i)
Advertisement
Add Comment
Please, Sign In to add comment