안녕하세요 run.py 실행을 시도했지만 오류 메시지가 나타납니다!
Run.py
from modules import HTTPHeaders
site = "https://google.com"
HTTPHeaders(site, _verbose=True)
HTTPHeaders.py
import dns
import dns.resolver
def HTTPHeaders(site, _verbose=None):
if _verbose != None:
try:
r = http.request('GET', "http://"+site)
except:
pass
if (r.status == 200):
print("HTTP/1.1 200 OK")
else:
print(r.status)
try:
print("Content-Type : "+r.headers['Content-Type'])
except:
pass
try:
print("Server : "+r.headers['Server'])
except:
pass
try:
print("Set-Cookie : "+r.headers['Set-Cookie'])
except:
pass
내 오류 :
TypeError: 'module' object is not callable
이 오류를 어떻게 해결할 수 있습니까? 감사합니다 :)
이 시도:
from modules import HTTPHeaders
HTTPHeaders.HTTPHeaders(...)
모듈 자체를 가져 왔으므로 점 표기법을 사용하여 함수에 액세스해야합니다.
또는 다음과 같이 함수를 가져옵니다.
from modules.HTTPHeaders import HTTPHeaders
HTTPHeaders(...)
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다