如何在G中使用pywhois模块

2024-06-16 11:14:09 发布

您现在位置:Python中文网/ 问答频道 /正文

我在尝试导入pywhois module时遇到问题,我可以导入自己的模块,但在导入pywhois时仍然有问题。我将pywhois文件夹移到了我的项目文件夹域中,屏幕截图如下: enter image description here

以下是导入和调用语句: 进口部件:

from pywhois import *

调用部分:

^{pr2}$

问题是它总是会抛出一个http 500错误,错误文本如下:

Traceback (most recent call last):
  File "/home/li/Desktop/google_appengine/google/appengine/ext/webapp/__init__.py", line 700, in __call__
    handler.get(*groups)
  File "/home/li/Desktop/google_appengine/domain/main.py", line 43, in get
    w = whois('hackbo.com')
  File "pywhois/__init__.py", line 12, in whois
    text = nic_client.whois_lookup(None, domain, 0)
  File "pywhois/whois.py", line 157, in whois_lookup
    result = self.whois(query_arg, nichost, flags)
  File "pywhois/whois.py", line 100, in whois
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
AttributeError: 'module' object has no attribute 'socket'

这个错误是什么意思?为什么我可以导入自己的模块却不能导入pywhois?在


Tags: 模块inpy文件夹home错误googleline
2条回答
import whois
site = input ("Enter Site : ")
n = whois.whois (site)
print (n)

这是最好的whois
好好享受,放松。在

googleappengine不支持socket模块,pywhois使用该模块。它允许您import socket,但是it's an empty module。在

相关问题 更多 >