SethRzeszutek / LinkedIn-Bot

A bot to automate your network on LinkedIn
GNU General Public License v3.0
43 stars 23 forks source link

[Errno 22] Invalid argument #9

Open johnnycash133 opened 2 years ago

johnnycash133 commented 2 years ago

File "C:\Users\Martin\Desktop\LinkedIn-Bot-master\LinkedIn-Bot-master\LinkedInBot-Convert.py", line 556, in createCSV with open(os.path.join(os.path.dirname(os.path.realpath(file)), 'CSV', filename), 'w') as csvFile: OSError: [Errno 22] Invalid argument: 'C:\Users\Martin\Desktop\LinkedIn-Bot-master\LinkedIn-Bot-master\CSV\Linked-In-04:31:03.827482.csv'

brettaio commented 11 months ago

update code with following in LinkedInBot-Convert.py :

def createCSV(data, time): ''' Creates an initial CSV file. data is the list that will get added to the file (in this case, it's the headers). time is the time at creation of this file. ''' formattedtime = time.replace(":", "") # Replace colons with underscores filename = 'Linked-In-' + formatted_time + '.csv' with open(os.path.join(os.path.dirname(os.path.realpath(file)), 'CSV', filename), 'w') as csvFile: writer = csv.writer(csvFile) writer.writerow(data) csvFile.close()