mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
add better logic
This commit is contained in:
parent
0da0d5480f
commit
c9891b8023
1 changed files with 1 additions and 0 deletions
|
|
@ -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]]]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue