thank u brother for replay and for trying to help but unfortunately does not work i test it on multi machines with py3 and py2 i dont know what is the problem :( i will send u my domain list on inbox check it and try to help me : my final code :
# encoding=utf8 import sys #reload(sys) #sys.setdefaultencoding('utf8') import requests as qan import time from beautifultable import BeautifulTable import warnings from datetime import datetime now = datetime.now() # current date and time from timeit import default_timer as timer warnings.filterwarnings('ignore', message='Unverified HTTPS request') table = BeautifulTable() def readfile(): with open('/root/domain.txt') as fp: for line in fp: try: start = timer() http = "http://" + line.rstrip() u = qan.get(http ,verify= False) u = (str(u.status_code)) table.column_headers =["Website", "Status", "Time S/M "] table.column_alignments['Website'] = BeautifulTable.ALIGN_LEFT table.set_style(BeautifulTable.STYLE_MARKDOWN) end = timer() table.append_row([http, u, str(end - start) ]) print(table) #print(http + " \t\t\t== > Status : " + u + " \t took : " + str(time.clock()) ) continue except qan.exceptions.HTTPError as errh: continue except qan.exceptions.ConnectionError as errc: continue except qan.exceptions.Timeout as errt: continue except qan.exceptions.RequestException as err: continue readfile()
Output:| Website | Status | Time S/M |
|---------------------|--------|-----------|
| http://xxxxx.com.ni | 200 | 1.008 |
| Website | Status | Time S/M |
|--------------------------------|--------|-----------|
| http://xxxxx.com.ni | 200 | 1.008 |
| http://xxxxxxxxxxxxxxxx.com.ni | 200 | 0.82 |
| Website | Status | Time S/M |
|--------------------------------|--------|-----------|
| http://xxxxx.com.ni | 200 | 1.008 |
| http://xxxxxxxxxxxxxxxx.com.ni | 200 | 0.82 |
| http://xxxxxxx.com.ni | 200 | 0.516 |
| Website | Status | Time S/M |
|--------------------------------|--------|-----------|
| http://xxxxx.com.ni | 200 | 1.008 |
| http://xxxxxxxxxxxxxxxx.com.ni | 200 | 0.82 |
| http://xxxxxxx.com.ni | 200 | 0.516 |
| http://xxxxxxxxx.com.ni | 200 | 0.538 |