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
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:
Hi! I tried to do tracking on a number LB469941154US
Like so:
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:
karrio/modules/sdk/karrio/core/utils/xml.py
Line 69 in 00aef36
this returns nothing
but if I remove the dot, it works this way:
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
The text was updated successfully, but these errors were encountered: