Попробуйте, без регулярных выражений:
scr = soup.find_all('script', id="BbbDtmData")
scr2 = soup.find_all('div', class_="Details-sc-1vh1927-0 hHqWfJ")
companies = []
ids = []
for co in range(len(scr2)):
companies.append(scr2[co].find('a').text)
companies.append(scr2[co].find('strong').text)
id_dat = scr[0].text
target = id_dat.split('var bbbDtmData = ')
data = json.loads(target[1])
final = data2['search']['results']
for i in final:
ids.append(i['businessId'])
for co, id in zip(companies, ids):
print(co,id)
Вывод для связанной страницы:
Template Studios/Jinx Studios 94645
115 East 57th St, New York, NY 10022 144428
Roark Tech Services 120257
New York, NY 10017-2452 85275
и т. Д.