with open("text.txt", 'r') as file:
list = [line.strip() for line in file]
list2 = []
for URL in list:
my_parse(URL, headers)
list2.append(URL)
for remList in list2:
list.remove(remList)
with open("text.txt", 'wb') as file:
for line in list:
file.wrie(line + '\n')