Вы можете думать о своем процессе очистки как о дереве, в котором вы переходите по каждой ветви страниц.Так что в некотором грубом псевдокоде это будет выглядеть примерно так:
company_details = {}
request the landing page and parse
for letter_href in landing_page:
scrape the company_code URL and parse
company_code = some_code_you_scraped
for company_href in company_code_page:
scrape the company page URL and parse
append each company info to the company_details dictionary including the company_code you grabbed from the previous page.
Надеюсь, это поможет!