-
Notifications
You must be signed in to change notification settings - Fork 12
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
Auto-checkout: Large orders take longer to complete checkout - selected slot may be lost. #12
Comments
Interesting - looks like it timed out waiting for Would you mind running with the |
Mark, |
I'll be pushing some changes shortly and will increase the timeout |
@b3ll0v1c Looks like you're both having the same issue here; I haven't been able to reproduce it. Try the new version of the code with the longer timeout, and run with the |
Same here, running with --debug now.
|
@b3nw Try pulling the most recent version with the longer timeout |
@mark-thompson |
@genericjim Excellent! This could also be an issue of order size? There's probably some kind of stock validation done per cart item upon purchase. I've generally been testing on small orders, so this may be why I'm not running into any problems. |
@mark-thompson |
@mark-thompson Testing the latest pull. Interesting theory about the number of items in the order. It could be actually the case as I have a huge (>80 items) order! Let's see how it goes and I'll report back. |
@b3ll0v1c that's an absolute unit of an order. you may want to increase the timeout further, though I suspect the slot may be gone by the time it validates all of your items. |
@mark-thompson This time it did not throw an exception but it failed with: INFO:main:Found 1 slots: Trying now with a small order (25 items) with --debug and see what happens... |
@b3ll0v1c I just got the exact same output for a slot at 7 PM today. I was watching in real time. It appeared to select the button to complete the order but the slot was taken before the transaction completed. Is this the script or is there really that much competition for open slots? This whole thing is starting to feel like it's pure luck the draw (I hope not though). |
@mark-thompson @btsands Success! A 25 item order went through fast and smoothly. It probably takes too long for larger orders to be validated/placed and the slots get lost. I'll try again to validate that it was not pure luck. However, I have not been successful for days with placing a large order, so this strategy seems to have more logic behind than just sheer luck. One other thing: I lower the sleep time (jitter) to 10, as I think that waiting for 20 +/- 20% seconds (if remember correct how the sleep time is calculated) is too long IMHO. |
@b3ll0v1c Good for you. I'll try the same. I currently have 49 items in cart. I'd rather have 25 than zero...lol |
@b3ll0v1c @btsands In your earlier attempts where you were redirected to slot select page after the unsuccessful checkout attempt, did it continue to wait for slots as intended? It's sounding like smaller orders are the way to go for high (relatively speaking) demand areas. As for the refresh delay, feel free to edit as you see fit, at your own peril. I chose a value high enough to avoid being obnoxious (and the potential account flags that could be associated with such behavior). |
@mark-thompson Yes on your first question. I was redirected to the slot select page. I agree about not being obnoxious, however I have seen other software using value of 6 and even 4 second, so I do agree that 10 is reasonable given the circumstances. Also, I just run into a use case where the code was not able to handle when some items becomes unavailable. I was able to capture the debug log if you are interested. Pls LMK. |
@b3ll0v1c That would be great, yes. Could you just send the |
@b3ll0v1c @mark-thompson For the first time my order went through! I ended up with 29 items, and I did change the jitter value to 10. Mark thanks so, so much for sharing this. |
@mark-thompson I didn't see any source_dump_*.html file in the directory where I started the script. Does the dump file get deleted when run.py restarts? I captured the log from the standard output. Attached. Thanks again! |
@b3ll0v1c Ah, looks like you must have manually clicked continue before it timed out? Thus avoiding the error. When it encounters a Selenium error, it saves the source HTML to the current directory |
The script is working well and picks the slot. It presses continue on the payment methods page. However it throws and exception on the next page which is the final confirmation place order page.
Running Windows + Chrome 81
`INFO:main:Attempting to select slot and checkout
INFO:main:Selecting slot: Tomorrow::8:00 AM - 10:00 AM
INFO:nav:Navigating <Route beginning at 'https://www.amazon.com/gp/buy/shipoptionselect/handlers/display.html' with 3 stops>
INFO:nav:Navigating <Waypoint ('xpath', "//*[contains(@Class, 'ufss-overview-continue-button')]") -> 'gp/buy/payselect/handlers/display.html'>
INFO:nav:Navigated to 'gp/buy/payselect/handlers/display.html'
INFO:nav:Navigating <Waypoint ('id', 'continue-top') -> 'gp/buy/spc/handlers/display.html'>
WARNING:nav:Current URL 'https://www.amazon.com/gp/buy/payselect/handlers/display.html' does not match target
Handling possible redirect (timeout in 10s)
Traceback (most recent call last):
File "C:\Users\Hello\Desktop\whole-foods-deliverance\nav.py", line 96, in navigate
WebDriverWait(driver, timeout).until(
File "C:\Users\Hello\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\selenium\webdriver\support\wait.py", line 80, in until
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "run.py", line 170, in
main_loop(driver, args)
File "run.py", line 144, in main_loop
site_config.Routes.CHECKOUT.navigate(driver)
File "C:\Users\Hello\Desktop\whole-foods-deliverance\nav.py", line 100, in navigate
raise e
File "C:\Users\Hello\Desktop\whole-foods-deliverance\nav.py", line 78, in navigate
self.navigate_waypoint(driver, waypoint, timeout)
File "C:\Users\Hello\Desktop\whole-foods-deliverance\nav.py", line 59, in navigate_waypoint
raise NavigationException(
nav.NavigationException: Message: Navigation to 'gp/buy/spc/handlers/display.html' failed
`
The text was updated successfully, but these errors were encountered: