diff --git a/etl/epc_recommendations/find_my_epc_pipeline.py b/etl/epc_recommendations/find_my_epc_pipeline.py index 4971c1b4..778df390 100644 --- a/etl/epc_recommendations/find_my_epc_pipeline.py +++ b/etl/epc_recommendations/find_my_epc_pipeline.py @@ -24,6 +24,7 @@ def retrieve_find_my_epc_data(postcode: str, address: str): address_links_full = postcode_res.findAll('a', {'class': 'govuk-link', 'rel': 'nofollow'}) address_links = {element.text.lstrip().rstrip(): BASE_ENERGY_URL + element['href'] for element in address_links_full} + # TODO: to check the logic works for all cases but seems to be good index_of_address = [key.startswith(address) for key in list(address_links.keys())] chosen_epc = address_links[list(address_links.keys())[np.where(index_of_address)[0][0]]]