Created
October 20, 2013 04:36
-
-
Save nuit/7065114 to your computer and use it in GitHub Desktop.
whois.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import requests | |
import re | |
import socket | |
url=raw_input(">> ") | |
site = 'http://www.iana.org/whois?q='+url | |
r = requests.get(site) | |
soup = BeautifulSoup(r.text) | |
for s in soup.findAll('pre'): | |
regex = re.compile(r'<[^<]*?>') | |
whois = regex.sub('', str(s)) | |
print whois |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#python3
from bs4 import BeautifulSoup
import requests
import re
import socket
url=input(">> ")
site = 'http://www.iana.org/whois?q='+url
r = requests.get(site)
soup = BeautifulSoup(r.text, "html.parser")
for s in soup.findAll('pre'):
regex = re.compile(r'<[^<]*?>')
whois = regex.sub('', str(s))
print (whois)