Я также нашел альтернативный способ решить эту проблему:
import pandas as pd
from bs4 import BeautifulSoup, Tag
import requests
import re
data=[]
res=requests.get("https://directory.justice.org/SearchResult.asp?access=public&firstmiddlename=&middlename=&lastname=&maidenname=&firmname=&city=&provstateid=&zip=&countryid=&keyword=&areaofpractice=&areaofpractice2=Personal+Injury§iontype=&memtype=&sb=&gender=Any")
soup=BeautifulSoup(res.text,'lxml')
lawyer=soup.findAll('div',{'style':'float:left'})
for item in lawyer:
lawyer_company=(item.contents[0].text)
lawyer_name=(item.contents[2])
lawyer_address=(item.contents[4])
lawyer_city=(item.contents[6])
lawyer_state=(item.contents[6])
lawyer_zip=(item.contents[6])
lawyer_phone=(item.contents[8])
lawyer_email=(item.contents[11])
if isinstance(lawyer_email, Tag):
lawyer_email=lawyer_email.text.strip()
lawyer_website=(item.contents[13])
if isinstance(lawyer_website, Tag):
lawyer_website=lawyer_website.text.strip()
full_dict={'Company':lawyer_company, 'Name':lawyer_name,'Address':lawyer_address,'City':lawyer_city,'State':lawyer_state,'Zip':lawyer_zip,'Phone':lawyer_phone,'Email':lawyer_phone,'Website':lawyer_website}
data.append(full_dict)
df=pd.DataFrame(data)
print(df)