Closed JamesOsborn-SE closed 10 months ago
I have a "household", so maybe that's the difference? do you have this? https://www.amazon.com/myh/households
I have a "household", so maybe that's the difference? do you have this? https://www.amazon.com/myh/households
Yes, I have a household with one other adult to share Prime benefits, no teens/children. Sounds like we're the same on that front?
I have a "household", so maybe that's the difference? do you have this? https://www.amazon.com/myh/households
Yes, I have a household with one other adult to share Prime benefits, no teens/children. Sounds like we're the same on that front?
I have a teen... 🤷🏻
I have a "household", so maybe that's the difference? do you have this? https://www.amazon.com/myh/households
Yes, I have a household with one other adult to share Prime benefits, no teens/children. Sounds like we're the same on that front?
I have a teen... 🤷🏻
Curious, does having a teen effect your my orders page? For instance, I can't see on my My Orders page what the other adult in my house buys. Maybe having a teen you can, and thus it effects which page they're rendering?
I have a "household", so maybe that's the difference? do you have this? https://www.amazon.com/myh/households
Yes, I have a household with one other adult to share Prime benefits, no teens/children. Sounds like we're the same on that front?
I have a teen... 🤷🏻
Curious, does having a teen effect your my orders page? For instance, I can't see on my My Orders page what the other adult in my house buys. Maybe having a teen you can, and thus it effects which page they're rendering?
Yes, I can see their orders, so that would be a difference.
Do you have the duck that says (meow) at the bottom of the HTML?
I have a "household", so maybe that's the difference? do you have this? https://www.amazon.com/myh/households
Yes, I have a household with one other adult to share Prime benefits, no teens/children. Sounds like we're the same on that front?
I have a teen... 🤷🏻
Curious, does having a teen effect your my orders page? For instance, I can't see on my My Orders page what the other adult in my house buys. Maybe having a teen you can, and thus it effects which page they're rendering?
Yes, I can see their orders, so that would be a difference.
Do you have the duck that says (meow) at the bottom of the HTML?
I do. Several of the test resources I've committed are obfuscated versions of a couple of my orders and order history pages.
With you having a household, I'm curious if you have more than just the year filter? Maybe you have a way to filter to just your orders, and perhaps in that case the pages would match.
Longer term I think the sustainable solution is to always have a chain of selectors, because inevitably we're going to run in to different pages for different people (regionality), Amazon A/B testing, and/or new pages (but still needing to support legacy pages). For instance, see the develop
branch for how I've modified the auth flow to support multiple form class types, which others can easily add. We won't need a class for each field, but I migrate entity fields to use CSS selectors instead of the find()
method likes they do now, I think every one should iterate over a list of selectors (and by default they'll all just start with 1) to see if any of them work for the field. Then when someone finds a new flow, they can just append to that field's list without causing any regressions.
With you having a household, I'm curious if you have more than just the year filter? Maybe you have a way to filter to just your orders, and perhaps in that case the pages would match.
Here is a scrubbed URL if you're interested: https://www.amazon.com/gp/your-account/order-history?opt=ab&delegatedCustId=AMAZON_CID&digitalOrders=1&unifiedOrders=1&returnTo=&householdCid=DIFFERENT_AMAZON_ID&orderFilter=year-2023
I also have a dropdown above the year dropdown
name="householdCid"
with option values of the AMAZON_CID and inner text of FULL_NAME's Orders
These are also on the page when looking at the teen orders:
With you having a household, I'm curious if you have more than just the year filter? Maybe you have a way to filter to just your orders, and perhaps in that case the pages would match.
Here is a scrubbed URL if you're interested: https://www.amazon.com/gp/your-account/order-history?opt=ab&delegatedCustId=AMAZON_CID&digitalOrders=1&unifiedOrders=1&returnTo=&householdCid=DIFFERENT_AMAZON_ID&orderFilter=year-2023
I also have a dropdown above the year dropdown name="householdCid" with option values of the AMAZON_CID and inner text of
FULL_NAME's Orders
These are also on the page when looking at the teen orders:
Alright, try this out. Hope over to develop
branch, then change constants.TIME_FILTER_QUERY_PARAM
to have the value of orderFilter
instead. What does that give you? If that works, I can also add the optional householdCid
param, which I think will let you filter individual's orders.
Also, if you run get_order()
to get a single order instead of the history, does that work for you?
Alright, try this out. Hope over to
develop
branch, then changeconstants.TIME_FILTER_QUERY_PARAM
to have the value oforderFilter
instead. What does that give you? If that works, I can also add the optionalhouseholdCid
param, which I think will let you filter individual's orders.
That worked, except items don't have prices.
Also, if you run
get_order()
to get a single order instead of the history, does that work for you?
this works and it gets the price.
Great, that's progress! If you have a look at Item._parse_price()
, you can compare that to what you see on your history page, and if you find the difference, let me know or feel free to contribute another PR. Looking at how I currently do it, it's not surprising it's finicky.
Now I just need to think of a way to automagically detect which query parameter to use.
We should be good to close out this PR then, yes? Or you can leave it open if you want to use it to fiddle around with parsing the price still. Once I stabilize what I have in develop
with tests and a few more changes, I'll merge it in to main
and cut a new release.
Great, that's progress! If you have a look at
Item._parse_price()
, you can compare that to what you see on your history page, and if you find the difference, let me know or feel free to contribute another PR. Looking at how I currently do it, it's not surprising it's finicky.yeah
Now I just need to think of a way to automagically detect which query parameter to use. It may be another page load, but if your "drop down" says "timeFilter*" compared to mine that says "orderFilter*".
Basing qurey string filter name on that should work.. here is an example from my orders:
<div class="a-popover-wrapper"><div class="a-popover-inner a-lgtbox-vertical-scroll" style="height: 575px; overflow-y: auto; min-width: 124.617px; width: auto;"><ul tabindex="-1" class="a-nostyle a-list-link" role="listbox" aria-multiselectable="false"><li tabindex="0" role="option" aria-labelledby="orderFilter_0" class="a-dropdown-item"><a tabindex="-1" href="javascript:void(0)" aria-hidden="true" data-value="{"stringVal":"last30"}" id="orderFilter_0" class="a-dropdown-link">
last 30 days
</a></li><li tabindex="0" role="option" aria-checked="true" aria-labelledby="orderFilter_1" class="a-dropdown-item"><a tabindex="-1" href="javascript:void(0)" aria-hidden="true" data-value="{"stringVal":"months-3"}" id="orderFilter_1" class="a-dropdown-link a-active">
past 3 months
</a></li><li tabindex="0" role="option" aria-labelledby="orderFilter_2" class="a-dropdown-item"><a tabindex="-1" href="javascript:void(0)" aria-hidden="true" data-value="{"stringVal":"year-2024"}" id="orderFilter_2" class="a-dropdown-link">
2024
</a></li><li tabindex="0" role="option" aria-labelledby="orderFilter_3" class="a-dropdown-item"><a tabindex="-1" href="javascript:void(0)" aria-hidden="true" data-value="{"stringVal":"year-2023"}" id="orderFilter_3" class="a-dropdown-link">
2023
</a></li><li tabindex="0" role="option" aria-labelledby="orderFilter_4" class="a-dropdown-item"><a tabindex="-1" href="javascript:void(0)" aria-hidden="true" data-value="{"stringVal":"year-2022"}" id="orderFilter_4" class="a-dropdown-link">
2022
</a></li>
</ul></div></div>
We should be good to close out this PR then, yes? Or you can leave it open if you want to use it to fiddle around with parsing the price still. Once I stabilize what I have in
develop
with tests and a few more changes, I'll merge it in tomain
and cut a new release.
yeah.
@JamesOsborn-SE Thanks for your help here, it was invaluable! The latest on develop
attempts to dynamically get the timeFilter
or orderFilter
query parameter based on the form that's on the order history landing page, let me know if it works for you!
Description change links to what works on my account
Issues
10
Type of Change
Testing Done any manual testing done. Need to add new test Need to fix existing test
Checklist