Example I have this code
with open("palavras.txt","r",encoding='ISO-8859-1') as f:
for line in f:
palavras.append(line)
sinonimos=[]
nr_palavras = len(palavras)
palavras_com_sinonimos=[]
def fazer():
for i in range(0,nr_palavras):
URL = 'https://www.sinonimos.com.br/'+palavras[i].replace('\n','')
texto_html = requests.get(URL)
if texto_html.status_code==404:
print(" A Palavra {} não existe".format(palavras[i].replace('\n','')))
else:
palavras_com_sinonimos.append(palavras[i].replace('\n',''))
Theres more than 2 million words in palavras.txt that will take alot time, theres any thing I can do to run it faster ?