簡體   English   中英

嘗試在 python 中使用 whois 但在 windows 中找不到文件錯誤

[英]Trying to use whois in python but getting file not found error in windows

我正在嘗試使用 whois 但收到此錯誤:

在此處輸入圖像描述

我還安裝了https://docs.microsoft.com/en-us/sysinternals/downloads/whois ,它在我的 cmd 中運行良好,但是當我嘗試使用 Z23EEEB4347BDD26BZFC6B7EE9A3B755DD 時,它會顯示上述錯誤。

在此處輸入圖像描述

我已經使用以下命令安裝了 python-whois 和 whois,但仍然出現相同的錯誤。

pip install python-whois
pip install whois

編輯: whois.whois() 不工作它顯示以下錯誤:

AttributeError:模塊“whois”沒有屬性“whois”

所以我改用 whois.query()

我的代碼和 output: 在此處輸入圖像描述

如果您已將 python-whois 正確安裝到 Python 運行時環境中,則例如:

import whois

wd = whois.whois('google.com')

然后,例如:

print(*wd['domain_name'])

Output:

GOOGLE.COM google.com

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM