Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pythonwhois/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,10 @@ def parse_raw_whois(raw_data, normalized=None, never_query_handles=True, handle_
# SIDN isn't very standard either. And EURid uses a similar format.
match = re.search("Registrar:\n\s+(?:Name:\s*)?(\S.*)", segment)
if match is not None:
data["registrar"].insert(0, match.group(1).strip())
try:
data["registrar"].insert(0, match.group(1).strip())
except KeyError:
data["registrar"] = [match.group(1).strip()]
match = re.search("(?:Domain nameservers|Name servers):([\s\S]*?\n)\n", segment)
if match is not None:
chunk = match.group(1)
Expand Down
44 changes: 44 additions & 0 deletions test/data/google.ca
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[Querying whois.cira.ca]
[whois.cira.ca]
Domain name: google.ca
Domain status: registered
Creation date: 2000/10/03
Expiry date: 2016/04/28
Updated date: 2015/03/27
DNSSEC: Unsigned

Registrar:
Name: MarkMonitor International Canada Ltd.
Number: 5000040

Registrant:
Name: Google Inc.

Administrative contact:
Name: Christina Chiou
Postal address: 130 King St. W., Suite 1800,
Toronto ON M5X1E3 Canada
Phone: +1.4168653361x
Fax: +1.4169456616
Email: [email protected]

Technical contact:
Name: Matt Serlin
Postal address: Domain Provisioning,10400 Overland Rd. PMB 155
Boise ID 83709 United States
Phone: +1.2083895740x
Fax: +1.2083895771
Email: [email protected]

Name servers:
ns1.google.com
ns2.google.com
ns3.google.com
ns4.google.com

% WHOIS look-up made at 2015-12-09 17:11:53 (GMT)
%
% Use of CIRA's WHOIS service is governed by the Terms of Use in its Legal
% Notice, available at http://www.cira.ca/legal-notice/?lang=en
%
% (c) 2015 Canadian Internet Registration Authority, (http://www.cira.ca/)
1 change: 1 addition & 0 deletions test/target_default/google.ca
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"status": ["registered"], "updated_date": ["2015-03-27T00:00:00"], "contacts": {"admin": null, "tech": null, "registrant": null, "billing": null}, "nameservers": ["ns1.google.com", "ns2.google.com", "ns3.google.com", "ns4.google.com"], "expiration_date": ["2016-04-28T00:00:00"], "creation_date": ["2000-10-03T00:00:00"], "raw": ["[Querying whois.cira.ca]\n[whois.cira.ca]\nDomain name: google.ca\nDomain status: registered\nCreation date: 2000/10/03\nExpiry date: 2016/04/28\nUpdated date: 2015/03/27\nDNSSEC: Unsigned\n\nRegistrar:\n Name: MarkMonitor International Canada Ltd.\n Number: 5000040\n\nRegistrant:\n Name: Google Inc.\n\nAdministrative contact:\n Name: Christina Chiou\n Postal address: 130 King St. W., Suite 1800,\n Toronto ON M5X1E3 Canada\n Phone: +1.4168653361x\n Fax: +1.4169456616\n Email: [email protected]\n\nTechnical contact:\n Name: Matt Serlin\n Postal address: Domain Provisioning,10400 Overland Rd. PMB 155\n Boise ID 83709 United States\n Phone: +1.2083895740x\n Fax: +1.2083895771\n Email: [email protected]\n\nName servers:\n ns1.google.com\n ns2.google.com\n ns3.google.com\n ns4.google.com\n\n% WHOIS look-up made at 2015-12-09 17:11:53 (GMT)\n%\n% Use of CIRA's WHOIS service is governed by the Terms of Use in its Legal\n% Notice, available at http://www.cira.ca/legal-notice/?lang=en \n%\n% (c) 2015 Canadian Internet Registration Authority, (http://www.cira.ca/) \n"], "registrar": ["MarkMonitor International Canada Ltd."], "emails": ["[email protected]", "[email protected]"]}
1 change: 1 addition & 0 deletions test/target_normalized/google.ca
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"status": ["Registered"], "updated_date": ["2015-03-27T00:00:00"], "contacts": {"admin": null, "tech": null, "registrant": null, "billing": null}, "nameservers": ["ns1.google.com", "ns2.google.com", "ns3.google.com", "ns4.google.com"], "expiration_date": ["2016-04-28T00:00:00"], "creation_date": ["2000-10-03T00:00:00"], "raw": ["[Querying whois.cira.ca]\n[whois.cira.ca]\nDomain name: google.ca\nDomain status: registered\nCreation date: 2000/10/03\nExpiry date: 2016/04/28\nUpdated date: 2015/03/27\nDNSSEC: Unsigned\n\nRegistrar:\n Name: MarkMonitor International Canada Ltd.\n Number: 5000040\n\nRegistrant:\n Name: Google Inc.\n\nAdministrative contact:\n Name: Christina Chiou\n Postal address: 130 King St. W., Suite 1800,\n Toronto ON M5X1E3 Canada\n Phone: +1.4168653361x\n Fax: +1.4169456616\n Email: [email protected]\n\nTechnical contact:\n Name: Matt Serlin\n Postal address: Domain Provisioning,10400 Overland Rd. PMB 155\n Boise ID 83709 United States\n Phone: +1.2083895740x\n Fax: +1.2083895771\n Email: [email protected]\n\nName servers:\n ns1.google.com\n ns2.google.com\n ns3.google.com\n ns4.google.com\n\n% WHOIS look-up made at 2015-12-09 17:11:53 (GMT)\n%\n% Use of CIRA's WHOIS service is governed by the Terms of Use in its Legal\n% Notice, available at http://www.cira.ca/legal-notice/?lang=en \n%\n% (c) 2015 Canadian Internet Registration Authority, (http://www.cira.ca/) \n"], "registrar": ["MarkMonitor International Canada Ltd."], "emails": ["[email protected]", "[email protected]"]}