특정 도메인의 많은 항목 목록을 가져 오기 위해 pythonwhois 모듈을 사용하고 있습니다 .
def whois(self):
host = str(self.EntryText.get().lstrip("http://www."))
whois = pythonwhois.net.get_whois_raw(host)
print whois
whois
위는 다음과 같은 항목 목록을 반환합니다.
[u "도메인 이름 : google.com \ n 레지스트리 도메인 ID : \ n 등록 기관 WHOIS 서버 : whois.markmonitor.com \ n 등록 기관 URL : http://www.markmonitor.com \ n 업데이트 날짜 : 2014-05-19T04 : 00 : 17 -0700 \ n 생성 날짜 : 1997-09-15T00 : 00 : 00-0700 \ n 레지스트라 등록 만료 날짜 : 2020-09-13T21 : 00 : 00-0700 \ n
내 질문은 : 어떻게 목록을 반복하고 결과를 사람이 읽을 수있는 우아한 목록으로 인쇄합니까?
간단한 방법은 반환 된 각 문자열을 간단히 인쇄하는 것입니다 whois
.
host = 'stackoverflow.com'
whois = pythonwhois.net.get_whois_raw(host)
for item in whois:
print item
다음과 같은 결과가 출력됩니다.
Domain Name: STACKOVERFLOW.COM
Registrar WHOIS Server: whois.name.com
Registrar URL: http://www.name.com
Updated Date: 2014-05-09T17:51:17-06:00
Creation Date: 2003-12-26T19:18:07-07:00
Registrar Registration Expiration Date: 2015-12-26T19:18:07-07:00
Registrar: Name.com, Inc.
Registrar IANA ID: 625
Registrar Abuse Contact Email: [email protected]
Registrar Abuse Contact Phone: +1.17202492374
Reseller:
Domain Status: clientTransferProhibited
Registrant Name: Sysadmin Team
Registrant Organization: Stack Exchange, Inc.
Registrant Street: 1 Exchange Plaza , Floor 26
Registrant City: New York
Registrant State/Province: NY
Registrant Postal Code: 10006
Registrant Country: US
etc.
이보다 더 우아한 것은 pythonwhois.get_whois(host)
반환 된 사전 서식 을 사용 하고 탐색 한 다음 관심있는 필드를 표시해야합니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다