-
Notifications
You must be signed in to change notification settings - Fork 15
Extract deceased field to its own function #136
Conversation
@rgreinho searches = [
(Fields.DECEASED, re.compile(r'>Deceased:\s*(?:</span>)?(?:</strong>)?\s*>?([^<]*\d)\s*.*\)?<')),
(Fields.LOCATION, re.compile(r'>Location:.*>\s{2,}(?:</strong>)?([^<]+)')),
] If so, what would you like to call the new function, since |
Oh you're right! so let's do the following:
And we should be good to go! |
The function parse_deceased_field() was created to pull content from the corresponding field on the fatality page. There was an existing function of the same name, which has now been renamed process_deceased_field(). Test cases have been made for the new parse_deceased_field(). Fixes scrapd#106
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good job overall! Just one minor comment to check whether or not we succeeded to parse the field before adding it do the results.
The deceased field will not be created in the dictionary unless a match was found. Fixes scrapd#106
And merged! Great work @anthonybaulo! |
Types of changes
Description
Extract deceased field to its own function with tests.
Rename previous parse_deceased_field() to process_deceased_field()
Checklist:
Fixes: #106