You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Parse the scan history on the package tracking page into Tracking #192
I have searched Issues to see if the feature has already been requested
I have enabled debug mode and am attaching relevant console logs and HTML files
Summary
Tracking reads the carrier and tracking number from the package tracking page, but not the events on the same page (delivered, out for delivery, etc.). Thoughts on a Tracking.events list, so a caller can see when and where a package last moved without parsing the page a second time?
Describe the Enhancement
The carrier layout of the package tracking page lists its scans by day: under each .tracking-event-date-header ("Monday, January 5") follow rows with .tracking-event-time, .tracking-event-message and .tracking-event-location. progress-tracker-ups.html and progress-tracker-amazon.html already carry them.
Proposed:
Tracking.events: Optional[List[TrackingEvent]], newest first as the page lists them, read through safe_parse. None when the page shows no scan list (the status-only layout).
TrackingEvent(Parsable) with date (the day as the page writes it), time ("11:02 AM", or None on a row without one), message and location (None when blank).
Selectors beside FIELD_TRACKING_CARRIER_SELECTOR.
date stays text because the page gives no year: turning it into a date needs a reference day that parse_tracking doesn't take, and assuming today would make the same page parse differently depending on when it's read.
Tests would assert on the two existing fixtures, so no new resources are needed.
Happy to open a PR for your review if you think this makes sense!
Describe Alternative Solutions/Workarounds
Parsing the scan list outside the library, from the same HTML parse_tracking already reads. It works, but it is a second parser of one page that drifts from the library's selectors whenever Amazon changes the layout, and every caller that wants the history has to write it.
Activity