Skip to content

Commit 9349814

Browse files
committed
Some fixes for weird data.
1 parent 123f944 commit 9349814

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

devopsdays.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ def parse_event(url):
6666
else:
6767
raise ValueError(f'Unable to find end date in {url}')
6868

69-
name_parts = root.select('.welcome-page')[0].string.split()
69+
name_elm = root.select('.welcome-page')
70+
if not name_elm:
71+
name_elm = root.select('title')
72+
name_parts = name_elm[0].string.split()
7073
name_parts[0] = name_parts[0].capitalize()
7174
name = ' '.join(name_parts)
7275

linux_foundation.py

+3
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ def fetch_smapply_json():
5858

5959
def parse_smapply_json():
6060
for data in fetch_smapply_json():
61+
if not data['startdate']:
62+
# Malformed data.
63+
continue
6164
yield {
6265
'Conference Name': data['name'],
6366
'CFP Start Date': dateparser.parse(data['startdate']).astimezone(pytz.utc).date(),

0 commit comments

Comments
 (0)