■ ■ ■ ■ ■ ■
modules/RelatedNumbers.py
| skipped 1 lines |
2 | 2 | | import requests, re |
3 | 3 | | from insides.bcolors import bcolors |
4 | 4 | | |
5 | | - | def RelatedNumbers(mail,_verbose=None): |
| 5 | + | def RelatedNumbers(mail, _verbose=None): |
6 | 6 | | if _verbose != None: |
7 | 7 | | try: |
8 | | - | dnsurl = ("https://domainbigdata.com/email/"+mail) |
9 | | - | response = requests.get(dnsurl) |
10 | | - | html = response.content |
| 8 | + | html = requests.get(f"https://domainbigdata.com/email/{ mail }").content |
11 | 9 | | soup=BeautifulSoup(html,"html.parser") |
12 | 10 | | rgx = str(soup) |
13 | | - | urls = re.findall('<td colspan="2">\+.*.</td>', rgx) |
14 | | - | for x in range(len(urls)): |
15 | | - | n = urls[x].replace("<td colspan="+'"'+'2'+'"'+'>', "") |
| 11 | + | phones = re.findall('<td colspan="2">\+.*.</td>', rgx) |
| 12 | + | for phone in phones: |
| 13 | + | number = urls[x].replace("<td colspan="+'"'+'2'+'"'+'>', "").replace("</td>","") |
16 | 14 | | print(n) |
| 15 | + | if len(phones) == 0: |
| 16 | + | print(f"{bcolors.FAIL}No phone numbers found!{bcolors.ENDC}") |
17 | 17 | | except: |
18 | 18 | | print(f"{bcolors.FAIL}Phone Number Data Error!{bcolors.ENDC}") |
19 | 19 | | |