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

Encountered error AFTER successful checkout #29

Closed
dougwebb opened this issue Apr 22, 2020 · 4 comments
Closed

Encountered error AFTER successful checkout #29

dougwebb opened this issue Apr 22, 2020 · 4 comments

Comments

@dougwebb
Copy link

I've been running commit 0a83c6 most of the morning, with no issues. I'd seen it occasionally cycling through the cart pages, but most of the time it was just refreshing. My conf.toml is an exact copy of conf_template.toml, and the command options I used were:

python run.py --service "Amazon Fresh" --checkout --ignore-oos --save-cart

A few minutes ago, it started seeing open slots, and after a couple of attempts to grab one it managed to finish the checkout process. After that, I got the error below. Chrome is sitting on the "Thank you, your Amazon Fresh order has been placed" confirmation page, https://www.amazon.com/gp/buy/thankyou/handlers/display.html?...

This is on Win10, btw. I was getting the audio alert about the slots being available, but I don't think I got one to confirm the order.

[2020-04-22 14:16:36] {get_slots} INFO: Found 2 slots:
Today::8:00 PM - 10:00 PM
Today::10:00 PM - 12:00 AM
[2020-04-22 14:16:36] {main_loop} INFO: Selecting slot: Today::8:00 PM - 10:00 PM
[2020-04-22 14:16:36] {navigate} INFO: Navigating <Route beginning at 'https://www.amazon.com/gp/buy/shipoptionselect/handlers/display.html' with 3 stops>
[2020-04-22 14:16:36] {navigate_waypoint} INFO: Navigating <Waypoint [('xpath', "//*[contains(@class, 'ufss-overview-continue-button')]"), ('xpath', "//input[@class='a-button-text a-declarative' and @type='submit']")] -> 'gp/buy/payselect/handlers/display.html'>
[2020-04-22 14:16:44] {navigate_waypoint} INFO: Navigated to 'gp/buy/payselect/handlers/display.html'
[2020-04-22 14:16:44] {navigate_waypoint} INFO: Navigating <Waypoint ('id', 'continue-top') -> 'gp/buy/spc/handlers/display.html'>
[2020-04-22 14:16:55] {navigate_waypoint} INFO: Navigated to 'gp/buy/spc/handlers/display.html'
[2020-04-22 14:16:55] {navigate_waypoint} INFO: Navigating <Waypoint ('xpath', "//input[contains(@class, 'place-your-order-button')]") -> 'gp/buy/thankyou/handlers/display.html'>
[2020-04-22 14:17:02] {handle_redirect} WARNING: Redirected to: 'https://www.amazon.com/gp/buy/spc/handlers/static-submit-decoupled.html/ref=ox_spc_place_order'
[2020-04-22 14:17:02] {alert} INFO: Alerting user with message: 'Encountered an error'
Traceback (most recent call last):
  File "C:\Users\Doug\source\repos\whole-foods-deliverance\deliverance\nav.py", line 109, in navigate
    self.navigate_waypoint(driver, waypoint, timeout,
  File "C:\Users\Doug\source\repos\whole-foods-deliverance\deliverance\nav.py", line 90, in navigate_waypoint
    raise NavigationException(
deliverance.exceptions.NavigationException: Message: Navigation to 'gp/buy/thankyou/handlers/display.html' failed


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "run.py", line 217, in <module>
    main_loop(driver, args)
  File "run.py", line 168, in main_loop
    build_route(site_config, 'CHECKOUT', args).navigate(driver)
  File "C:\Users\Doug\source\repos\whole-foods-deliverance\deliverance\nav.py", line 112, in navigate
    handle_redirect(driver,
  File "C:\Users\Doug\source\repos\whole-foods-deliverance\deliverance\nav.py", line 46, in handle_redirect
    raise UnhandledRedirect()
deliverance.exceptions.UnhandledRedirect: Message: None
@eoprede
Copy link
Contributor

eoprede commented Apr 23, 2020

Ran into same issue with Fresh. I thought it's because I am using smile as web site, but could be related to Fresh vs Whole Foods.

@mark-thompson
Copy link
Owner

mark-thompson commented Apr 23, 2020

This should be patched for now. Let me know if you have any issues

@mark-thompson
Copy link
Owner

Actually, just saw that you eventually ended up at the right place @dougwebb .
Redirects like this should be handled via a WebDriverWait call, but it appears theres a bug in handle_redirect when traversing the last waypoint in a route - the redirect wait is bypassed because valid_destinations=None.
As I'm not sure if static-submit-decoupled.html necessarily means the order was placed successfully, I'm going to remove it from the waypoint config.

@mark-thompson
Copy link
Owner

Closing this for now - let me know if this is still an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants