I'm going to be handling this, but I wanted to point out the fact that the code for counting mail items relies on a image being present for the mail item in question. Many times, there will be mail items present without a scanned image. The current logic for checking for mail items assumes a image will always be present.
for row in parsed.find_all('div', {'class': 'mailpiece'}):
image = _get_mailpiece_image(row)
if not image: