def item_found(self, response): found_resource = response.url LOGGER.log(CUSTOM_LOGGING.RES_FOUND, found_resource) item = Result() item['url'] = found_resource # STORE THE RESULTS # Opening the file... target = open(self.sessionFilename, 'a+') target.write(found_resource) target.write("\n") # ... and close target.close() return item