Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cover cases where there is no station #7

Merged
merged 2 commits into from
Mar 31, 2021

Conversation

verdurin
Copy link
Contributor

I found that in a few cases the download would fail because there was no station, so I've added a simple test, with the default value of London if nothing is found. I'm sure this could be made more elegant...

@everdrone
Copy link
Owner

Hi! Thanks for the contribution!

Do you think it would work if we wrote it like this?

station = title_box.div.div.h2.find(text=True, recursive=False)
if not station:
    station = 'London'
else:
    station = station.strip()

I think it would be better to minimize the beautifulsoup calls

@verdurin
Copy link
Contributor Author

Yes, that's much better.

@everdrone
Copy link
Owner

Great!
If you can update your branch with the new code I'll merge it asap!

@everdrone everdrone merged commit 5ddbac5 into everdrone:master Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants