Hi! I tried to do tracking on a number LB469941154US
Like so:
request = karrio.Tracking.fetch(TrackingRequest(tracking_numbers=["LB469941154US"]))
tracking_details_list, messages = request.from_(canadapost_gateway).parse()
It returns empty array for both
But this code does exist and is trackable. When checking, proper XML is returned by canadapost api, but then the lib doesn't parse it well
Here's some part of what it returns:
Deserializable(value=['<?xml version="1.0" encoding="UTF-8"?>\n<tracking-detail xmlns="http://www.canadapost.ca/ws/track-v2"><pin>LB469941154US</pin><active-exists>1</active-exists><archive-exists/><changed-expected-date>2024-09-09</changed-expected-date><destination-postal-id>L4P0K2</destination-postal-id>
Then code does this:
details = lib.find_element("tracking-detail", response)
And it fails
Digging deeper:
nodes = [*in_element.xpath(f"//*[local-name() = '{tag}']")]
And it returns full TrackingDetails
I am not sure if it's proper fix, wanted to consult with you as I don't know what dot means in xpath parsing
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too