Extract the checkpoints and store in self.tracking_data

def Extract_Checkpoints(self):
		'''
			Extract the checkpoints and store in self.tracking_data
		'''

		# Make sure page is available
		if self.page is None:
			raise Exception("The HTML data was not fetched due to some reasons")

		soup = BeautifulSoup(self.page,'html.parser')

		invalid_tracking_no = soup.find('span',{'id':'ctl00_ContentPlaceHolder1_lblsMsg','class':'ErrorMessage','style':'font-family:Calibri;font-size:9pt;font-weight:bold;','name':'lblsMsg'})
		if invalid_tracking_no is not None:
			raise ValueError('The Tracking number is invalid')

		# Assign the current status of the shipment

		if 'Delivered' in self.page:
			self.status = 'C'
		else:											 # The shipment is in Transit
			self.status = 'T'						

		# Checkpoints extraction begins here 
		
		rows = soup.findAll('tr',{'class':'gridItem'}) + soup.findAll('tr',{'class':'gridAltItem'})

		for row in rows:

			'''
				Each row will have 4 columns: Date--Time--Status--Location
				Merge column one and two and format it. 
				Append to tracking_data list
			'''
			row_cells = row.findAll('td')

			date = row_cells[0].string.strip()
			time = row_cells[1].string.strip()
			date_time = ' '.join([date,time])
			date_time_format = "%d %b %Y %H:%M"
			date_time = datetime.strptime(date_time,date_time_format)
			status = row_cells[2].string.strip()
			location = row_cells[3].string.strip()
			
			self.tracking_data.append({'status':status,'date':date_time,'location':location})

		# Sort the checkpoints based on Date and Time --- this is important
		self.tracking_data = sorted(self.tracking_data, key=lambda k: k['date'])