本文介绍了我想使用PHP或任何语言将原始html whois查找数据转换为json或xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从获取了whois查找的代码。



但我得到原始数据或html数据..我得到一个输出,但不像在json或xml中的可读格式..我怎么可以将其转换成json ..
粘贴示例输入您的电子邮件地址*:您的电子邮件地址:您朋友的电邮地址:(必填)联系电话:*您的电子邮件:*您的邮件地址*:您的电子邮件:*您的邮件地址*:您的电子邮件:*你必须输入你的电子邮件地址。域名:ttmm.com
注册域名:
注册商WHOIS服务器:whois.ename.com
注册商网址:http://www.ename.net
更新日期: 1998-11-25 T05:00:00Z
创建日期:1998-11-25 T05:00:00Z
注册商注册到期日期:2016-11-24 T05:00:00Z
注册商:eName科技有限公司
注册服务商IANA ID:1331
注册商滥用联系方式电子邮件:[email protected]
注册商滥用联系电话:+86.4000044400
域名状态:clientDeleteProhibited
https:// www.icann.org/epp#clientDeleteProhibited
域名状态:clientTransferProhibited https://www.icann.org/epp#clientTransferProhibited
注册机构注册人ID:注册机构不可用
注册人姓名:chousteven
注册人机构:hua you
注册人街道:an cun daxue cheng
注册人城市:ping xiang shi
注册人州/省:jiang xi
注册人邮编: 337000
注册人国家:CN
注册人电话:+86.15979220355
注册人电话分机:
注册人传真:+86.15979220355
注册人传真分机:
注册人电子邮件: [email protected]
注册表管理员ID:不可用注册表
管理员姓名:chousteven
管理员组织:hua you
管理员街道:an cun daxue cheng
管理员城市:ping x iang shi
行政区州/省:jiang xi
行政邮政编码:337000
行政国家:CN
行政电话:+86.15979220355
行政电话分机:
管理员传真:+86.15979220355
管理员传真分机:
管理员电子邮件:[email protected]
注册表技术ID:不在注册表中提供
技术名称:chousteven
技术组织:华元
科技街:元元大学城
科技城:平祥石
科技州/省:江西
科技邮政编码:337000
技术国家:CN
技术电话:+86.15979220355
技术电话分机:
技术传真:+86.15979220355
技术传真分机:
技术电子邮件:stekiss @ 163。 com
名称服务器:ns1.alidns.com
名称服务器:ns2.alidns.com
DNSSEC:无符号
ICANN WHOIS数据问题报告系统的URL:http:// wdprs.internic.net/
>>> WHOIS数据库的最新更新:2015-11-19 T12:53:51Z<<
有关Whois状态码的更多信息,请访问
https://www.icann.org/resources/pages/epp-status-codes-2014-06-16-en


解决方案

大量的自定义分析。抱歉。没有简单的解决方案。



WHOIS回复没有标准格式。至少,大多数注册管理机构的回复格式略有不同;此外,.COM和.NET等精简注册管理机构要求每个注册服务机构实施他们自己的WHOIS服务器,每个服务器都有自己略有不同的特殊格式。

正如其他人所指出的,有付费的API可以为您解析。根据您的需要,这可能是一个比尝试自己分析几千种不同格式更合适的解决方案。


I got this code for whois lookup from here.

but i am getting raw data or html data .. i am getting an output but not in readable format like in json or xml .. how i can convert this into json ..pasting a example output

ttmm.com domain lookup results from whois.ename.com server:

enter code here Domain Name: ttmm.com
Registry Domain ID:
Registrar WHOIS Server: whois.ename.com
Registrar URL: http://www.ename.net
Updated Date: 1998-11-25 T05:00:00Z
Creation Date: 1998-11-25 T05:00:00Z
Registrar Registration Expiration Date: 2016-11-24 T05:00:00Z
Registrar: eName Technology Co.,Ltd.
Registrar IANA ID: 1331
Registrar Abuse Contact Email: [email protected]
Registrar Abuse Contact Phone: +86.4000044400
Domain Status: clientDeleteProhibited
https://www.icann.org/epp#clientDeleteProhibited
Domain Status: clientTransferProhibited             https://www.icann.org/epp#clientTransferProhibited
 Registry Registrant ID:Not Available From Registry
Registrant Name: chousteven
Registrant Organization: hua you
Registrant Street: an yuan cun daxue cheng
Registrant City: ping xiang shi
Registrant State/Province: jiang xi
Registrant Postal Code: 337000
Registrant Country: CN
Registrant Phone: +86.15979220355
Registrant Phone Ext:
Registrant Fax: +86.15979220355
Registrant Fax Ext:
Registrant Email: [email protected]
Registry Admin ID:Not Available From Registry
Admin Name: chousteven
Admin Organization: hua you
Admin Street: an yuan cun daxue cheng
Admin City: ping xiang shi
Admin State/Province: jiang xi
Admin Postal Code: 337000
Admin Country: CN
Admin Phone: +86.15979220355
Admin Phone Ext:
Admin Fax: +86.15979220355
Admin Fax Ext:
Admin Email: [email protected]
Registry Tech ID:Not Available From Registry
Tech Name: chousteven
Tech Organization: hua you
Tech Street: an yuan cun daxue cheng
Tech City: ping xiang shi
Tech State/Province: jiang xi
Tech Postal Code: 337000
Tech Country: CN
Tech Phone: +86.15979220355
Tech Phone Ext:
Tech Fax: +86.15979220355
Tech Fax Ext:
Tech Email: [email protected]
Name Server: ns1.alidns.com
Name Server: ns2.alidns.com
DNSSEC: unsigned
URL of the ICANN WHOIS Data Problem Reporting System:    http://wdprs.internic.net/
>>> Last update of WHOIS database: 2015-11-19 T12:53:51Z <<<
For more information on Whois status codes, please visit
https://www.icann.org/resources/pages/epp-status-codes-2014-06-16-en
解决方案

Lots of custom parsing. Sorry. There is no simple solution.

There is no standard format for WHOIS responses. At a minimum, most registries have a slightly different format for responses; additionally, "thin registries" such as .COM and .NET require every registrar to implement their own WHOIS server, each of which has its own slightly different, idiosyncratic format.

As others have noted, there are paid APIs available to do this parsing for you. Depending on your needs, this may be a more appropriate solution than trying to parse several thousand different formats yourself.

这篇关于我想使用PHP或任何语言将原始html whois查找数据转换为json或xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 16:25