Hello
I have a code that's going to search multiples times a string as long as the string appears in a .txt file and I'm obligated to use this form to search the strings :
data[data.index('"display_url":"'):data.index('","display_resources":')+1]
.
- How can I make it run and add the string that it find to my list (as long as it appears in the .txt) ?
The real part of the code :
urls = []
g = open('tet.txt','r') data=''.join(g.readlines())
dat = (data[data.index('"display_url":"'):data.index('","display_resources":')+1])
urls.append(dat)
g.close()
print(urls)
Thanks for your help