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'))
2
  • what is the error message you get Commented Apr 17, 2022 at 10:17
  • just save one line if i have 1000 line the output saved one line Commented Apr 17, 2022 at 10:19

1 Answer 1

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')
Sign up to request clarification or add additional context in comments.

5 Comments

thank you I searched on the internet for 1 day I can't find this problem thank you it's done
how ? I'm new here?
Thanks for the feedback! You need at least 15 reputation to cast a vote, but your feedback has been recorded. this?
ok, it's because you're new .Forget about it
thank you if i got rep i will back an I give you

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.