diff --git a/pythonwhois/parse.py b/pythonwhois/parse.py index 6c54669..7a18dd8 100644 --- a/pythonwhois/parse.py +++ b/pythonwhois/parse.py @@ -557,6 +557,7 @@ def parse_registrants(data): nic_contact_regexes = [ "personname:\s*(?P.+)\norganization:\s*(?P.+)\nstreet address:\s*(?P.+)\npostal code:\s*(?P.+)\ncity:\s*(?P.+)\ncountry:\s*(?P.+)\n(?:phone:\s*(?P.+)\n)?(?:fax-no:\s*(?P.+)\n)?(?:e-mail:\s*(?P.+)\n)?nic-hdl:\s*(?P.+)\nchanged:\s*(?P.+)", # nic.at + "contact-handle:[ ]*(?P.+)\ncontact:[ ]*(?P.+)\n(?:organisation:[ ]*(?P.+)\n)?address:[ ]*(?P.+)\n(?:address:[ ]*(?P.+)\n)?(?:address:[ ]*(?P.+)\n)?(?:address:[ ]*(?P.+)\n)?address:[ ]*(?P.+)\naddress:[ ]*(?P.+)\naddress:[ ]*(?P.+)\naddress:[ ]*(?P.+)\n(?:phone:[ ]*(?P.+)\n)?(?:fax:[ ]*(?P.+)\n)?(?:email:[ ]*(?P.+)\n)?", # LCN.com "person:\s*(?P.+)\nnic-hdl:\s*(?P.+)\n", # .ie "nic-hdl:\s*(?P.+)\ntype:\s*(?P.+)\ncontact:\s*(?P.+)\n(?:.+\n)*?(?:address:\s*(?P.+)\naddress:\s*(?P.+)\naddress:\s*(?P.+)\naddress:\s*(?P.+)\n)?(?:phone:\s*(?P.+)\n)?(?:fax-no:\s*(?P.+)\n)?(?:.+\n)*?(?:e-mail:\s*(?P.+)\n)?(?:.+\n)*?changed:\s*(?P[0-9]{2}\/[0-9]{2}\/[0-9]{4}).*\n", # AFNIC madness without country field "nic-hdl:\s*(?P.+)\ntype:\s*(?P.+)\ncontact:\s*(?P.+)\n(?:.+\n)*?(?:address:\s*(?P.+)\n)?(?:address:\s*(?P.+)\n)?(?:address:\s*(?P.+)\n)?(?:phone:\s*(?P.+)\n)?(?:fax-no:\s*(?P.+)\n)?(?:.+\n)*?(?:e-mail:\s*(?P.+)\n)?(?:.+\n)*?changed:\s*(?P[0-9]{2}\/[0-9]{2}\/[0-9]{4}).*\n", # AFNIC madness any country -at all- @@ -567,17 +568,21 @@ def parse_registrants(data): nic_contact_references = { "registrant": [ "registrant:\s*(?P.+)", # nic.at + "owner-contact:\s*(?P.+)", # LCN.com "holder-c:\s*(?P.+)", # AFNIC "holder:\s*(?P.+)", # iis.se (they apparently want to be difficult, and won't give you contact info for the handle over their WHOIS service) ], "tech": [ "tech-c:\s*(?P.+)", # nic.at, AFNIC, iis.se + "technical-contact:\s*(?P.+)", # LCN.com ], "admin": [ "admin-c:\s*(?P.+)", # nic.at, AFNIC, iis.se + "admin-contact:\s*(?P.+)", # LCN.com ], "billing": [ - "billing-c:\s*(?P.+)" # iis.se + "billing-c:\s*(?P.+)", # iis.se + "billing-contact:\s*(?P.+)", # LCN.com ] } @@ -634,8 +639,8 @@ def parse_registrants(data): match = re.search(regex, segment) if match is not None: data_reference = match.groupdict() - if data_reference["handle"] == "-": - pass # Blank + if data_reference["handle"] == "-" or re.match("https?:\/\/", data_reference["handle"]) is not None: + pass # Reference was either blank or a URL; the latter is to deal with false positives for nic.ru else: for contact in handle_contacts: if contact["handle"] == data_reference["handle"]: diff --git a/test/data/globallatedeals.com b/test/data/globallatedeals.com new file mode 100644 index 0000000..6686810 --- /dev/null +++ b/test/data/globallatedeals.com @@ -0,0 +1,142 @@ +Domain Registration Service Provided By: LCN.com + +The Data in LCN.com's WHOIS database is provided by LCN.com for information +purposes, and to assist persons in obtaining information about or related to a +domain name registration record. LCN.com does not guarantee its accuracy. + +By submitting a WHOIS query, you agree that you will use the data obtained only +for lawful purposes and that, under no circumstances will you use this data to: + +(a) allow, enable, or otherwise support the transmission by e-mail, telephone, +or facsimile of mass, unsolicited, commercial advertising or solicitations to +entities other than the data recipient's own existing customers; or (b) enable +high volume, automated, electronic processes that send queries or data to the +systems of LCN.com, except as reasonably necessary to register domain names or +modify existing registrations. + +By submitting this query, you agree to abide by this policy. + +LCN.com reserves the right to modify these terms at any time. + + + +domain: globallatedeals.com + +nameserver: ns1.stellatravel.co.uk +nameserver: ns2.stellatravel.co.uk +nameserver: ns3.stellatravel.co.uk + +owner-contact: LCN-816093 +admin-contact: LCN-816093 +technical-contact: AI-300624 +billing-contact: AI-300624 + +created: 2002-04-04 04:13:20 +expires: 2016-04-04 08:13:20 +changed: 2014-03-14 02:52:43.17135 + +contact-handle: LCN-816093 +contact: Paul Edwards +organisation: The Global Travel Group Limited +address: Ground Floor East, Bowling Mill +address: Dean Clough +address: West Yorkshire +address: HX3 5AX +address: GB +phone: +44.1274422167 +email: paul.edwards@sunmaster.co.uk + +contact-handle: AI-300624 +contact: Hostmaster +address: Units H, J, K +address: Gateway 1000 +address: Whittle Way +address: Stevenage +address: England +address: SG1 2FP +address: GB +phone: +44.1438342490 +fax: +44.1438300137 +email: support@lcn.com + + ***************************************************************************** +******************************************************************************* +** ** +** Domain Registration Service Provided By: LCN.com ** +** ------------------------------------------------ ** +** ** +** ** +** - For award winning domain name services visit: ** +** ** +** http://www.lcn.com/domain_names ** +** ** +** - For powerful & reliable web hosting backed by a 30 day money ** +** backed guarantee visit: ** +** ** +** http://www.lcn.com/web_hosting ** +** ** +** - For support visit: ** +** ** +** http://www.lcn.com/contact_us ** +** ** +******************************************************************************* + ***************************************************************************** + + +-- + +Whois Server Version 2.0 + +Domain names in the .com and .net domains can now be registered +with many different competing registrars. Go to http://www.internic.net +for detailed information. + + Domain Name: GLOBALLATEDEALS.COM + Registrar: LCN.COM LTD. + Whois Server: whois.lcn.com + Referral URL: http://www.lcn.com + Name Server: NS1.STELLATRAVEL.CO.UK + Name Server: NS2.STELLATRAVEL.CO.UK + Name Server: NS3.STELLATRAVEL.CO.UK + Status: clientDeleteProhibited + Status: clientTransferProhibited + Status: clientUpdateProhibited + Updated Date: 13-mar-2014 + Creation Date: 04-apr-2002 + Expiration Date: 04-apr-2016 + +>>> Last update of whois database: Tue, 29 Apr 2014 08:47:33 UTC <<< + +NOTICE: The expiration date displayed in this record is the date the +registrar's sponsorship of the domain name registration in the registry is +currently set to expire. This date does not necessarily reflect the expiration +date of the domain name registrant's agreement with the sponsoring +registrar. Users may consult the sponsoring registrar's Whois database to +view the registrar's reported date of expiration for this registration. + +TERMS OF USE: You are not authorized to access or query our Whois +database through the use of electronic processes that are high-volume and +automated except as reasonably necessary to register domain names or +modify existing registrations; the Data in VeriSign Global Registry +Services' ("VeriSign") Whois database is provided by VeriSign for +information purposes only, and to assist persons in obtaining information +about or related to a domain name registration record. VeriSign does not +guarantee its accuracy. By submitting a Whois query, you agree to abide +by the following terms of use: You agree that you may use this Data only +for lawful purposes and that under no circumstances will you use this Data +to: (1) allow, enable, or otherwise support the transmission of mass +unsolicited, commercial advertising or solicitations via e-mail, telephone, +or facsimile; or (2) enable high volume, automated, electronic processes +that apply to VeriSign (or its computer systems). The compilation, +repackaging, dissemination or other use of this Data is expressly +prohibited without the prior written consent of VeriSign. You agree not to +use electronic processes that are automated and high-volume to access or +query the Whois database except as reasonably necessary to register +domain names or modify existing registrations. VeriSign reserves the right +to restrict your access to the Whois database in its sole discretion to ensure +operational stability. VeriSign may restrict or terminate your access to the +Whois database for failure to abide by these terms of use. VeriSign +reserves the right to modify these terms at any time. + +The Registry database contains ONLY .COM, .NET, .EDU domains and +Registrars. diff --git a/test/target_default/globallatedeals.com b/test/target_default/globallatedeals.com new file mode 100644 index 0000000..21415e7 --- /dev/null +++ b/test/target_default/globallatedeals.com @@ -0,0 +1 @@ +{"updated_date": ["2014-03-14T02:52:43"], "status": ["clientDeleteProhibited", "clientTransferProhibited", "clientUpdateProhibited"], "contacts": {"admin": {"city": "Dean Clough", "handle": "LCN-816093", "name": "Paul Edwards", "phone": "+44.1274422167", "state": "West Yorkshire", "street": "Ground Floor East, Bowling Mill", "country": "GB", "postalcode": "HX3 5AX", "organization": "The Global Travel Group Limited", "email": "paul.edwards@sunmaster.co.uk"}, "tech": {"city": "Stevenage", "fax": "+44.1438300137", "handle": "AI-300624", "name": "Hostmaster", "phone": "+44.1438342490", "state": "England", "street": "Units H, J, K\nGateway 1000\nWhittle Way", "country": "GB", "postalcode": "SG1 2FP", "email": "support@lcn.com"}, "registrant": {"city": "Dean Clough", "handle": "LCN-816093", "name": "Paul Edwards", "phone": "+44.1274422167", "state": "West Yorkshire", "street": "Ground Floor East, Bowling Mill", "country": "GB", "postalcode": "HX3 5AX", "organization": "The Global Travel Group Limited", "email": "paul.edwards@sunmaster.co.uk"}, "billing": {"city": "Stevenage", "fax": "+44.1438300137", "handle": "AI-300624", "name": "Hostmaster", "phone": "+44.1438342490", "state": "England", "street": "Units H, J, K\nGateway 1000\nWhittle Way", "country": "GB", "postalcode": "SG1 2FP", "email": "support@lcn.com"}}, "nameservers": ["ns1.stellatravel.co.uk", "ns2.stellatravel.co.uk", "ns3.stellatravel.co.uk"], "expiration_date": ["2016-04-04T08:13:20"], "creation_date": ["2002-04-04T04:13:20"], "raw": ["Domain Registration Service Provided By: LCN.com\n\nThe Data in LCN.com's WHOIS database is provided by LCN.com for information\npurposes, and to assist persons in obtaining information about or related to a\ndomain name registration record. LCN.com does not guarantee its accuracy.\n\nBy submitting a WHOIS query, you agree that you will use the data obtained only\nfor lawful purposes and that, under no circumstances will you use this data to:\n\n(a) allow, enable, or otherwise support the transmission by e-mail, telephone,\nor facsimile of mass, unsolicited, commercial advertising or solicitations to\nentities other than the data recipient's own existing customers; or (b) enable\nhigh volume, automated, electronic processes that send queries or data to the\nsystems of LCN.com, except as reasonably necessary to register domain names or\nmodify existing registrations.\n\nBy submitting this query, you agree to abide by this policy.\n\nLCN.com reserves the right to modify these terms at any time.\n\n\n\ndomain: globallatedeals.com\n\nnameserver: ns1.stellatravel.co.uk \nnameserver: ns2.stellatravel.co.uk \nnameserver: ns3.stellatravel.co.uk \n\nowner-contact: LCN-816093\nadmin-contact: LCN-816093\ntechnical-contact: AI-300624\nbilling-contact: AI-300624\n\ncreated: 2002-04-04 04:13:20\nexpires: 2016-04-04 08:13:20\nchanged: 2014-03-14 02:52:43.17135\n\ncontact-handle: LCN-816093\ncontact: Paul Edwards\norganisation: The Global Travel Group Limited\naddress: Ground Floor East, Bowling Mill\naddress: Dean Clough\naddress: West Yorkshire\naddress: HX3 5AX\naddress: GB\nphone: +44.1274422167\nemail: paul.edwards@sunmaster.co.uk\n\ncontact-handle: AI-300624\ncontact: Hostmaster\naddress: Units H, J, K\naddress: Gateway 1000\naddress: Whittle Way\naddress: Stevenage\naddress: England\naddress: SG1 2FP\naddress: GB\nphone: +44.1438342490\nfax: +44.1438300137\nemail: support@lcn.com\n\n *****************************************************************************\n*******************************************************************************\n** **\n** Domain Registration Service Provided By: LCN.com **\n** ------------------------------------------------ **\n** **\n** **\n** - For award winning domain name services visit: **\n** **\n** http://www.lcn.com/domain_names **\n** **\n** - For powerful & reliable web hosting backed by a 30 day money **\n** backed guarantee visit: **\n** **\n** http://www.lcn.com/web_hosting **\n** **\n** - For support visit: **\n** **\n** http://www.lcn.com/contact_us **\n** **\n*******************************************************************************\n *****************************************************************************\n\n", "\nWhois Server Version 2.0\n\nDomain names in the .com and .net domains can now be registered\nwith many different competing registrars. Go to http://www.internic.net\nfor detailed information.\n\n Domain Name: GLOBALLATEDEALS.COM\n Registrar: LCN.COM LTD.\n Whois Server: whois.lcn.com\n Referral URL: http://www.lcn.com\n Name Server: NS1.STELLATRAVEL.CO.UK\n Name Server: NS2.STELLATRAVEL.CO.UK\n Name Server: NS3.STELLATRAVEL.CO.UK\n Status: clientDeleteProhibited\n Status: clientTransferProhibited\n Status: clientUpdateProhibited\n Updated Date: 13-mar-2014\n Creation Date: 04-apr-2002\n Expiration Date: 04-apr-2016\n\n>>> Last update of whois database: Tue, 29 Apr 2014 08:47:33 UTC <<<\n\nNOTICE: The expiration date displayed in this record is the date the \nregistrar's sponsorship of the domain name registration in the registry is \ncurrently set to expire. This date does not necessarily reflect the expiration \ndate of the domain name registrant's agreement with the sponsoring \nregistrar. Users may consult the sponsoring registrar's Whois database to \nview the registrar's reported date of expiration for this registration.\n\nTERMS OF USE: You are not authorized to access or query our Whois \ndatabase through the use of electronic processes that are high-volume and \nautomated except as reasonably necessary to register domain names or \nmodify existing registrations; the Data in VeriSign Global Registry \nServices' (\"VeriSign\") Whois database is provided by VeriSign for \ninformation purposes only, and to assist persons in obtaining information \nabout or related to a domain name registration record. VeriSign does not \nguarantee its accuracy. By submitting a Whois query, you agree to abide \nby the following terms of use: You agree that you may use this Data only \nfor lawful purposes and that under no circumstances will you use this Data \nto: (1) allow, enable, or otherwise support the transmission of mass \nunsolicited, commercial advertising or solicitations via e-mail, telephone, \nor facsimile; or (2) enable high volume, automated, electronic processes \nthat apply to VeriSign (or its computer systems). The compilation, \nrepackaging, dissemination or other use of this Data is expressly \nprohibited without the prior written consent of VeriSign. You agree not to \nuse electronic processes that are automated and high-volume to access or \nquery the Whois database except as reasonably necessary to register \ndomain names or modify existing registrations. VeriSign reserves the right \nto restrict your access to the Whois database in its sole discretion to ensure \noperational stability. VeriSign may restrict or terminate your access to the \nWhois database for failure to abide by these terms of use. VeriSign \nreserves the right to modify these terms at any time. \n\nThe Registry database contains ONLY .COM, .NET, .EDU domains and\nRegistrars.\n"], "whois_server": ["whois.lcn.com"], "registrar": ["LCN.com", "LCN.com **"]} \ No newline at end of file diff --git a/test/target_normalized/globallatedeals.com b/test/target_normalized/globallatedeals.com new file mode 100644 index 0000000..21415e7 --- /dev/null +++ b/test/target_normalized/globallatedeals.com @@ -0,0 +1 @@ +{"updated_date": ["2014-03-14T02:52:43"], "status": ["clientDeleteProhibited", "clientTransferProhibited", "clientUpdateProhibited"], "contacts": {"admin": {"city": "Dean Clough", "handle": "LCN-816093", "name": "Paul Edwards", "phone": "+44.1274422167", "state": "West Yorkshire", "street": "Ground Floor East, Bowling Mill", "country": "GB", "postalcode": "HX3 5AX", "organization": "The Global Travel Group Limited", "email": "paul.edwards@sunmaster.co.uk"}, "tech": {"city": "Stevenage", "fax": "+44.1438300137", "handle": "AI-300624", "name": "Hostmaster", "phone": "+44.1438342490", "state": "England", "street": "Units H, J, K\nGateway 1000\nWhittle Way", "country": "GB", "postalcode": "SG1 2FP", "email": "support@lcn.com"}, "registrant": {"city": "Dean Clough", "handle": "LCN-816093", "name": "Paul Edwards", "phone": "+44.1274422167", "state": "West Yorkshire", "street": "Ground Floor East, Bowling Mill", "country": "GB", "postalcode": "HX3 5AX", "organization": "The Global Travel Group Limited", "email": "paul.edwards@sunmaster.co.uk"}, "billing": {"city": "Stevenage", "fax": "+44.1438300137", "handle": "AI-300624", "name": "Hostmaster", "phone": "+44.1438342490", "state": "England", "street": "Units H, J, K\nGateway 1000\nWhittle Way", "country": "GB", "postalcode": "SG1 2FP", "email": "support@lcn.com"}}, "nameservers": ["ns1.stellatravel.co.uk", "ns2.stellatravel.co.uk", "ns3.stellatravel.co.uk"], "expiration_date": ["2016-04-04T08:13:20"], "creation_date": ["2002-04-04T04:13:20"], "raw": ["Domain Registration Service Provided By: LCN.com\n\nThe Data in LCN.com's WHOIS database is provided by LCN.com for information\npurposes, and to assist persons in obtaining information about or related to a\ndomain name registration record. LCN.com does not guarantee its accuracy.\n\nBy submitting a WHOIS query, you agree that you will use the data obtained only\nfor lawful purposes and that, under no circumstances will you use this data to:\n\n(a) allow, enable, or otherwise support the transmission by e-mail, telephone,\nor facsimile of mass, unsolicited, commercial advertising or solicitations to\nentities other than the data recipient's own existing customers; or (b) enable\nhigh volume, automated, electronic processes that send queries or data to the\nsystems of LCN.com, except as reasonably necessary to register domain names or\nmodify existing registrations.\n\nBy submitting this query, you agree to abide by this policy.\n\nLCN.com reserves the right to modify these terms at any time.\n\n\n\ndomain: globallatedeals.com\n\nnameserver: ns1.stellatravel.co.uk \nnameserver: ns2.stellatravel.co.uk \nnameserver: ns3.stellatravel.co.uk \n\nowner-contact: LCN-816093\nadmin-contact: LCN-816093\ntechnical-contact: AI-300624\nbilling-contact: AI-300624\n\ncreated: 2002-04-04 04:13:20\nexpires: 2016-04-04 08:13:20\nchanged: 2014-03-14 02:52:43.17135\n\ncontact-handle: LCN-816093\ncontact: Paul Edwards\norganisation: The Global Travel Group Limited\naddress: Ground Floor East, Bowling Mill\naddress: Dean Clough\naddress: West Yorkshire\naddress: HX3 5AX\naddress: GB\nphone: +44.1274422167\nemail: paul.edwards@sunmaster.co.uk\n\ncontact-handle: AI-300624\ncontact: Hostmaster\naddress: Units H, J, K\naddress: Gateway 1000\naddress: Whittle Way\naddress: Stevenage\naddress: England\naddress: SG1 2FP\naddress: GB\nphone: +44.1438342490\nfax: +44.1438300137\nemail: support@lcn.com\n\n *****************************************************************************\n*******************************************************************************\n** **\n** Domain Registration Service Provided By: LCN.com **\n** ------------------------------------------------ **\n** **\n** **\n** - For award winning domain name services visit: **\n** **\n** http://www.lcn.com/domain_names **\n** **\n** - For powerful & reliable web hosting backed by a 30 day money **\n** backed guarantee visit: **\n** **\n** http://www.lcn.com/web_hosting **\n** **\n** - For support visit: **\n** **\n** http://www.lcn.com/contact_us **\n** **\n*******************************************************************************\n *****************************************************************************\n\n", "\nWhois Server Version 2.0\n\nDomain names in the .com and .net domains can now be registered\nwith many different competing registrars. Go to http://www.internic.net\nfor detailed information.\n\n Domain Name: GLOBALLATEDEALS.COM\n Registrar: LCN.COM LTD.\n Whois Server: whois.lcn.com\n Referral URL: http://www.lcn.com\n Name Server: NS1.STELLATRAVEL.CO.UK\n Name Server: NS2.STELLATRAVEL.CO.UK\n Name Server: NS3.STELLATRAVEL.CO.UK\n Status: clientDeleteProhibited\n Status: clientTransferProhibited\n Status: clientUpdateProhibited\n Updated Date: 13-mar-2014\n Creation Date: 04-apr-2002\n Expiration Date: 04-apr-2016\n\n>>> Last update of whois database: Tue, 29 Apr 2014 08:47:33 UTC <<<\n\nNOTICE: The expiration date displayed in this record is the date the \nregistrar's sponsorship of the domain name registration in the registry is \ncurrently set to expire. This date does not necessarily reflect the expiration \ndate of the domain name registrant's agreement with the sponsoring \nregistrar. Users may consult the sponsoring registrar's Whois database to \nview the registrar's reported date of expiration for this registration.\n\nTERMS OF USE: You are not authorized to access or query our Whois \ndatabase through the use of electronic processes that are high-volume and \nautomated except as reasonably necessary to register domain names or \nmodify existing registrations; the Data in VeriSign Global Registry \nServices' (\"VeriSign\") Whois database is provided by VeriSign for \ninformation purposes only, and to assist persons in obtaining information \nabout or related to a domain name registration record. VeriSign does not \nguarantee its accuracy. By submitting a Whois query, you agree to abide \nby the following terms of use: You agree that you may use this Data only \nfor lawful purposes and that under no circumstances will you use this Data \nto: (1) allow, enable, or otherwise support the transmission of mass \nunsolicited, commercial advertising or solicitations via e-mail, telephone, \nor facsimile; or (2) enable high volume, automated, electronic processes \nthat apply to VeriSign (or its computer systems). The compilation, \nrepackaging, dissemination or other use of this Data is expressly \nprohibited without the prior written consent of VeriSign. You agree not to \nuse electronic processes that are automated and high-volume to access or \nquery the Whois database except as reasonably necessary to register \ndomain names or modify existing registrations. VeriSign reserves the right \nto restrict your access to the Whois database in its sole discretion to ensure \noperational stability. VeriSign may restrict or terminate your access to the \nWhois database for failure to abide by these terms of use. VeriSign \nreserves the right to modify these terms at any time. \n\nThe Registry database contains ONLY .COM, .NET, .EDU domains and\nRegistrars.\n"], "whois_server": ["whois.lcn.com"], "registrar": ["LCN.com", "LCN.com **"]} \ No newline at end of file