I have a Spider that takes the xlsx links, in the Request I call the files and saved in:
def save_file(self, response):
f = open("teste.xls", "wb")
f = write(response.body)
f.close()
But it returns the error:
f = write(response.body)
NameError: name 'write' is not defined
Can anyone help me solve this problem?