from bs4 import BeautifulSoup


def ParseProjects(aidData, htmlProjects):
	"""Parses the description of every project page.
	
	Args:
		aidData: list[] of dict{} of aid projects.
		htmlProjects: list[] of html texts.
	
	Returns:
		aidData: list[] of dict{} of aid projects.
			'unique-id': unique id for each project.
			'contract-number': contract number.
			'contract-title': title of the project.
			'country-region': country and/or region, where the project takes place.
			'OEZA-ADA-contract-volume': amount of funding.
			'contract-partner': partner organisation(s).
			'description': description text of the project.
			'url': url of the project page.
	"""
	for idx, html in enumerate(htmlProjects):
		soup = BeautifulSoup(html)
		aidData[int(idx)]['description'] = soup.find_all('table')[0].find_all('tr')[5].find_all('div')[1].text
	
	return aidData