Open
Conversation
ymann
commented
Mar 17, 2018
- Updated scraper to scrape homepage instead of different pages for each hall
- Added option to request multiple halls
- Removed broken code
esqu1
reviewed
Mar 31, 2018
penn/laundry.py
Outdated
| for row in rows: | ||
| cols = row.find_all('td') | ||
| if len(cols) > 1: | ||
| if len(cols) == 1 and len(cols[0].find_all('center')) == 1 and len(cols[0].find_all('center')[0].find_all('h2')) == 1: # Title element |
Contributor
There was a problem hiding this comment.
Put this on 2 columns; enforce the 80 character limit for style purposes.
esqu1
reviewed
Mar 31, 2018
penn/laundry.py
Outdated
| cols = row.find_all('td') | ||
| if len(cols) > 1: | ||
| if len(cols) == 1 and len(cols[0].find_all('center')) == 1 and len(cols[0].find_all('center')[0].find_all('h2')) == 1: # Title element | ||
| if(cols[0].find_all('center')[0].find_all('h2')[0].find_all('a')[0].getText() == hall): # Check if found correct hall |
Contributor
There was a problem hiding this comment.
if-else clause can be shortened: found_hall =
esqu1
requested changes
Mar 31, 2018
Contributor
esqu1
left a comment
There was a problem hiding this comment.
Make some style changes with the 80 character limit.
Member
|
Endpoint is still slow after only retrieving data once. Retrieving multiple halls is currently O(n^2), but could be refactored to be O(n). Since HTML parsing might be a relatively expensive operation, this might be why this endpoint is still slow. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.