Skip to content

Commit

Permalink
4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarKimo committed Aug 31, 2021
1 parent c152979 commit fc5c207
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ def run(self):
cnt += 1
col_data = []
for col in cols:
col_data.append(capwords(col.text))
if col == cols[0]:
col_data.append(f"{capwords(col.text)}{'' if col.text == 'Baltimore City' else ' County'}")
else:
col_data.append(capwords(col.text))
try:
links.append(
f"https://registers.maryland.gov/RowNetWeb/Estates/{col.find('a')['href']}")
Expand Down Expand Up @@ -214,7 +217,10 @@ def run(self):
cnt += 1
col_data = []
for col in cols:
col_data.append(capwords(col.text))
if col == cols[0]:
col_data.append(f"{capwords(col.text)}{'' if col.text == 'Baltimore City' else ' County'}")
else:
col_data.append(capwords(col.text))
try:
links.append(
f"https://registers.maryland.gov/RowNetWeb/Estates/{col.find('a')['href']}")
Expand Down Expand Up @@ -254,8 +260,7 @@ def run(self):
capwords(soup.find(name="span", attrs={"id": "lblWill"}).text))
data[idx].append(capwords(soup.find(name="span", attrs={
"id": "lblDateOfWill"}).text))
# https://registers.maryland.gov/RowNetWeb/Estates/frmDocketImages.aspx?src=row&RecordId=975129107
# https://registers.maryland.gov/RowNetWeb/Estates/frmDocketImages.aspx?src=row&RecordId=975544913

personal_reps = soup.find(
name="span", attrs={"id": "lblPersonalReps"}).text
tmp = 0
Expand Down Expand Up @@ -357,7 +362,7 @@ def run(self):
with open(error_file, mode="w") as f:
f.write(f"{len(Errors)} Errors happened: \n")
for i, error in enumerate(Errors):
f.write(f"#{i+1}: county {error[0]}, record #{error[1]+1}, link {error[2]}, {error[3]} at {error[4]}\n")
f.write(f"#{i+1}: {error[0]} {'' if error[0] == 'Baltimore City' else 'County'}, record #{error[1]+1}, link {error[2]}, {error[3]} at {error[4]}\n")
except Exception as e:
print(e)
exc_type, exc_obj, exc_tb = sys.exc_info()
Expand Down

0 comments on commit fc5c207

Please sign in to comment.