def check(url, timeout):
try:
if timeout <= 0:
timeout = 20
response = requests.head(url,timeout = timeout)
code = response.status_code
screenLock.acquire()
if code == 200:
ColorPrinter.print_green_text("[ " + str(code) + " ]")
print "Checking : " + url
if "404" in response.text:
ColorPrinter.print_blue_text(url + "\tMaybe every page same!")
elif code == 404 or code == 405:
pass
# ColorPrinter.print_red_text("[ " + str(code) + " ]")
# print "Checking : " + url
else:
ColorPrinter.print_blue_text("[ " + str(code) + " ]")
print "Checking : " + url
except Exception as e:
screenLock.acquire()
print e
finally:
screenLock.release()
评论列表
文章目录