i am working on subdomain chacker that test url's from file and print worcking one's first i used urllib not dowing the job saw i use requets and every thing work will bat i have error with the reqeust example of url:
https://et7-1.fab5-2-gdc.bf1.yahoo.com
my code
import argparse, requests
from requests.exceptions import MissingSchema
p = argparse.ArgumentParser()
p.add_argument("-f", "--file",required=True, help="subdomain file" )
args = p.parse_args()
def get_url_nofollow(url):
req = requests.get(url, timeout=5)
respnse = req.status_code()
if respnse == 200:
return respnse
def main():
url = {}
for line in args.file:
line=line.strip()
if line not in url:
print('chaching url %d', url)
url[line] = {'code': get_url_nofollow(line), 'count': 1}
print("++ %s\n" % str(urls[line]))
else:
urls[line]['count'] = urls[line]['count'] + 1
if __name__ == "__main__":
main()
thanks