instagram username checker python

Solutions on MaxInterview for instagram username checker python by the best coders in the world

showing results for - "instagram username checker python"
Joyce
12 Jan 2017
1import requests
2import random
3import time
4import urllib3
5urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
6
7f = open("username_text_file.txt", "r") # create a text file with the usernames you want to check
8data = f.readlines()
9
10for un in data:
11    time.sleep(1 * random.random())
12    url = "https://www.instagram.com/"+str(un[:4])
13    x = requests.get(url, verify = False)
14    if x.status_code == 200:
15        print("skip - " + un[:4]+ " - "+ str(data.index(un)))
16    else:
17        print("available - " + un[:4] + " - "+ str(data.index(un)))
18        f2 = open("available_usernames.txt", "a") # create a blank text file and it'll insert all the available usernames in there so you can check later
19        f2.write(un)
20        f2.close()
21    if int(data.index(un))%20 == 0:
22        time.sleep(5)
Stefano
16 Jul 2016
1//www.instagram.com/"+