handle case of no respone

This commit is contained in:
Khalim Conn-Kowlessar 2024-07-02 12:25:16 +01:00
parent d562324dd9
commit 654251c084

View file

@ -102,8 +102,8 @@ def retrieve_find_my_epc_data(uprn: int, postcode: str, address: str, expected_e
hot_water_text = bills.find_all('li')[1].text
resulting_data = {
'uprn': uprn,
'address': address,
'extracted_uprn': uprn,
'extracted_address': address,
'epc_certificate': epc_certificate,
'current_epc_rating': current_rating.split(' ')[-6],
'current_epc_efficiency': int(current_rating.split(' ')[-1]),
@ -163,6 +163,7 @@ def app():
collected_data.append(
{
**response,
"epc": property_data.to_dict(),
"epc_directory": directory
}
)