Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid reporting parse_return_eligible_date errors #24

Closed
3 tasks done
mkhazhinsky opened this issue Nov 1, 2024 · 3 comments
Closed
3 tasks done

Avoid reporting parse_return_eligible_date errors #24

mkhazhinsky opened this issue Nov 1, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@mkhazhinsky
Copy link

mkhazhinsky commented Nov 1, 2024

Acknowledgements

  • I have written a descriptive issue title
  • I have searched Issues to see if the feature has already been requested
  • If relevant, I have enabled debug mode and am attaching relevant console logs and HTML files

Describe the Feature

For some orders parsing return eligible dates fail with the following error:

When building Item, return_eligible_date could not be parsed.
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/amazonorders/entity/parsable.py", line 51, in safe_parse
return parse_function(**kwargs)
File "/usr/local/lib/python3.10/dist-packages/amazonorders/entity/item.py", line 80, in _parse_return_eligible_date
value = datetime.strptime(date_str, "%b %d, %Y").date()
File "/usr/lib/python3.10/_strptime.py", line 568, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
File "/usr/lib/python3.10/_strptime.py", line 349, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data 'November 9, 2024\n\n\n\n$27.99$27.99\n\n\n\n\n\n\n\n\n\nBuy it again\n\n\n \n \n \n View your item' does not match format '%b %d, %Y'

The error seems to happen for all subscription items, like the one in the attached example. It has an additional line "Auto-delivered: Every 3 months"

order-details_0 - Copy.zip

Describe Alternative Solutions/Workarounds

No response

@mkhazhinsky mkhazhinsky added the enhancement New feature or request label Nov 1, 2024
@alexdlaird
Copy link
Owner

This is due to a new tagging mechanism Amazon appears to be rolling out in the last couple weeks. It will eventually make parsing the pages a lot easier, but right now it's a but of a manual process to see what the new tags look like. Thanks for the example, I'll get this fixed!

@alexdlaird
Copy link
Owner

Fixed in 2.0.3. Thanks!

@alexdlaird alexdlaird added bug Something isn't working and removed enhancement New feature or request labels Nov 1, 2024
@mkhazhinsky
Copy link
Author

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants