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