这是我的代码:
import urllib
import re
import requests
import httplib
import socket
from colorama import *
from time import gmtime, strftime
def hell():
hcon = raw_input(Fore.RED + Style.BRIGHT + "Website: ")
r = requests.get("http://" + hcon + "/phpmyadmin")
r2 = requests.get("http://" + hcon + "/pma")
if r.status_code == 404:
print(strftime("[%H:%M:%S]", gmtime()) + " /phpmyadmin/ not found!")
elif r:
print(strftime("[%H:%M:%S]", gmtime()) + " /phpmyadmin/ successfully found! %s /phpmyadmin") % (hcon)
elif r2:
print(strftime("[%H:%M:%S]", gmtime()) + " /phpmyadmin/ successfully found! %s /pma") % (hcon)
else:
print(strftime("[%H:%M:%S]", gmtime()) + " nothing found, sorry! try another website.")
hell()
如您所见,如果页面 /phpmyadmin 或 /pma 存在于所选网站上,它将输出已成功找到,如果不存在,则会显示“未找到等”。
但是我收到了这个错误:unindent 与外部缩进级别不匹配,我以前的任何 python 脚本中都没有发生过这个错误。
我已尝试尽可能多地修复缩进,但我认为这不会解决它,有人可以帮忙吗?