themm1/procyclingstats

stage results Table Parser fails on results with empty teams or ages

Closed this issue · 1 comments

The Stage Results parser fails when some rows have empty values for age or team.

In some races riders do not have a team, or PCS does not know all ages. In that case a blank value is displayed.

For example: https://www.procyclingstats.com/race/nc-germany-we/2023/result

For the age it fails because an empty string can't be cast to an int. (table_parser.py:212)
This can be fixed by not casting the age to int, but leave it as an string. I don't know if this safe

For the teams it fails because the teams are found using _filter_a_elements. But an empty cell has no a_element and thus raises an UnexpectedParsingError.

themm1 commented

Sorry for being late with the fix, but it should work as expected now. The newest version isn't yet on PyPI, but it should be released soon.