'Google Event Not Creating with Google API Python
I'm working on a Python program that creates an event on my Google Calendar after grabbing data from other webpages. Below is the code and the ouput in my console after running it.
dataUnix = int(driver.find_element(By.CLASS_NAME, "time").get_attribute("data-unix")) / 1000
title = driver.title
start = str(datetime.utcfromtimestamp(dataUnix).isoformat('T')) + '.00Z'
end = str(datetime.utcfromtimestamp(dataUnix + 7200).isoformat('T')) + '.00Z'
print(dataUnix, title, start)
event = {
'title': title,
'summary': title,
'description':
'location': href,
'start': {
'dateTime': start,
'timeZone': 'America/Chicago',
},
'end': {
'dateTime': end,
'timeZone': 'America/Chicago',
},
}
def create():
service = get_calendar_service()
service.events().insert(calendarId = '[calendar id here]', body = event)
print("created event")
create()
The ouput comes out with no errors:
1652715300.0 ENCE vs. Heroic at PGL Major Antwerp 2022 | HLTV.org 2022-05-16T15:35:00.00Z
created event
However, when I check my Google calendar, the event that it claims is created isn't there. I've checked a large amount of documentation to make sure the time format is correct, but it just isn't being created. I'd expect some type of error to pop up if the event wasn't actually created, but there's no error and the program is apparently running as it's supposed to. Any ideas on how to fix this would be much appreciated.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
