|
55
|
1 |
Goal
|
|
|
2 |
====
|
|
|
3 |
|
|
|
4 |
- Create a simple importable Python module which will produce parsed
|
|
|
5 |
WHOIS data for a given domain.
|
|
|
6 |
- Able to extract data for all the popular TLDs (com, org, net, ...)
|
|
|
7 |
- Query a WHOIS server directly instead of going through an
|
|
|
8 |
intermediate web service like many others do.
|
|
|
9 |
- Works with Python 2.4+ and no external dependencies
|
|
|
10 |
|
|
|
11 |
Example
|
|
|
12 |
=======
|
|
|
13 |
|
|
|
14 |
.. sourcecode:: python
|
|
|
15 |
|
|
|
16 |
>>> import whois
|
|
|
17 |
>>> w = whois.whois('webscraping.com')
|
|
|
18 |
>>> w.expiration_date # dates converted to datetime object
|
|
|
19 |
datetime.datetime(2013, 6, 26, 0, 0)
|
|
|
20 |
>>> w.text # the content downloaded from whois server
|
|
|
21 |
u'\nWhois Server Version 2.0\n\nDomain names in the .com and .net
|
|
|
22 |
...'
|
|
|
23 |
|
|
|
24 |
>>> print w # print values of all found attributes
|
|
|
25 |
creation_date: 2004-06-26 00:00:00
|
|
|
26 |
domain_name: [u'WEBSCRAPING.COM', u'WEBSCRAPING.COM']
|
|
|
27 |
emails: [u'WEBSCRAPING.COM@domainsbyproxy.com', u'WEBSCRAPING.COM@domainsbyproxy.com']
|
|
|
28 |
expiration_date: 2013-06-26 00:00:00
|
|
|
29 |
...
|
|
|
30 |
|
|
|
31 |
Install
|
|
|
32 |
=======
|
|
|
33 |
|
|
|
34 |
Install from pypi:
|
|
|
35 |
|
|
|
36 |
.. sourcecode:: python
|
|
|
37 |
|
|
|
38 |
pip install python-whois
|
|
|
39 |
|
|
|
40 |
Or checkout latest version from repository:
|
|
|
41 |
|
|
|
42 |
.. sourcecode:: python
|
|
|
43 |
|
|
|
44 |
hg clone https://bitbucket.org/richardpenman/pywhois
|
|
|
45 |
|
|
|
46 |
Contact
|
|
|
47 |
=======
|
|
|
48 |
|
|
|
49 |
You can post ideas or patches here:
|
|
|
50 |
https://bitbucket.org/richardpenman/pywhois/issues
|
|
|
51 |
|
|
|
52 |
Thanks to the many who have sent patches for additional domains!
|