import requests f = open('working.txt', 'w') with open('wordlist.txt') as w: for line in w: response = requests.get('http://www.soundcloud.com/' + line.rstrip('\n')) if 'Playlists' in response.content.decode('utf-8'): pass else: f.write(line) print(line + " is available")