0

I have a problem with this line

    print(Fore.RED+'NOT Found: '+url ,file=open('output.txt','w'))

I need to save the request to this output but it's not working

res = requests.get(url)
        if payload in res.text:
           print(Fore.GREEN +'Found   -->','   ' , f"{url}" + Fore.RESET)
           
        else :
            print(Fore.RED+'XSS NOT Found: '+url ,file=open('output.txt','w'))

1 Answers1

1

Your problem is,

file=open('output.txt','w')

you use "w" parameter in your function."w" parameter deletes post information and overwrites current information all the time. If you want to append data to file, you should use

file=open('output.txt','a')
cesebe27
  • 305
  • 1
  • 10