-
Notifications
You must be signed in to change notification settings - Fork 3
/
phonenumber-scraper.py
31 lines (27 loc) · 986 Bytes
/
phonenumber-scraper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import os
import phonenumbers as a
from phonenumbers import carrier as b
from tkinter import*
from tkinter import messagebox as msg
import phonenumbers as pn
from phonenumbers import*
from phonenumbers.carrier import name_for_number
#Main function where, the phone number is sent to library for carrier analysis
def main():
try:
device = str(name_for_number(a.parse(e.get(),None),"en"))
msg.showinfo("Carrier",device)
except:
msg.showerror("Carrier","Try Again with - +<countrycode><yournumber>\n eg.= +919388*****")
#GUI of app
top= Tk()
top.title("Phone number scraper")
top.geometry("500x200")
k = Label(text="Enter the phone number with country code",font="40")
e = Entry(bd=5, font="36")
bb = Button(text="Scrap",command=main,relief="groove",activebackground="black", activeforeground="white",background="white",font=36)
#Positioning of widgets in Tkinter window
k.place(x=10,y=20)
e.place(x=60,y=50)
bb.place(x=110,y=100)
top.mainloop()