Im parsing data for study purposes so I create scraping module, data frame module and now I need to finish "upload to Google Drive data frame as Google Sheet" but stuck on this error.
from fileinput import filename
import gspread
credentials = {...
}
gc = gspread.oauth_from_dict(credentials)
tag = bs_search
sh = gc.open(filename, 'kid')
worksheet = sh.add_worksheet(title = tag, rows=100, cols=20)
worksheet.update([df.columns.values.tolist()] + df.values.tolist())
worksheet.update_cell(1, 4, 'Send to')
worksheet.update_cell(1, 5, 'Not Send to')
worksheet.update_cell(1, 6, 'Instagram')
Output:
13 gc = gspread.oauth_from_dict(credentials)
15 tag = bs_search
---> 16 sh = gc.open(filename, 'kid')
17 worksheet = sh.add_worksheet(title = tag, rows=100, cols=20)
18 worksheet.update([df.columns.values.tolist()] + df.values.tolist())
AttributeError: 'tuple' object has no attribute 'open'