I dont get why this code is saving the csv file on the folder 'chats', and not the 'chatroom' folder.
The name of the csv must be the chatroom + in + timestr .csv
#Make Selenium check the chatroom name
chatroom = driver.find_element_by_class_name('_19vo_').text
#Create a variable of a folder path with chatroom name
chat_path = 'D:\Drive\Outros\Python\data_save\chats\ ' + chatroom
#Verify if folder already exists, if not, create it
Path(chat_path).mkdir(parents=True, exist_ok=True)
#Save a df.csv to the chatroom folder
df.to_csv(chat_path +chatroom+' in'+ timestr +' .csv', index=None, header=True, encoding='utf-8-sig')The result of this, is a folder with the chatroom name, and a csv file named 'chatroomchatroom in...'