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")

		# Check for invalid tracking number
		if 'Numbers Not Found -'in self.page or 'Invalid Query Numbers -' in self.page:
			raise ValueError('The Tracking number is invalid')

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

		# Assign the current status of the shipment
		if 'Returned To Origin' in self.page:		 # Prioritise this first
			self.status = 'R'
		elif 'SHIPMENT DELIVERED' in self.page:	 # If the above is false, only then check for this
			self.status = 'C'
		else:											 # The shipment is in Transit
			self.status = 'T'						

		# Checkpoints extraction begins here 
		cells = []

		'''
			The below for loop goes through the table of checkpoints adding relevant cell data to cells[]
		'''

		for cell in soup.findAll('td', {"align" : "LEFT"}):
		    if cell.font["size"] == '1':
		    	cell_text = cell.font.string
		    	if self.is_valid(cell_text):
		    		cells.append(cell_text)

		# 4 cells in each row
		rows = [cells[cell:cell + 4] for cell in xrange(0, len(cells), 4)]

		for row in rows:

			'''
				Each row will have 4 columns: Location--Status--Date--Time
				Merge column three and four and format it. 
				Append to tracking_data list
			'''

			location = row[0]
			status = row[1]
			date_time = ' '.join((row[2],row[3]))
			date_time_format = "%d-%b-%Y %H:%M"
			date_time = datetime.strptime(date_time,date_time_format)

			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'])