alexschimpf / Snkrs-Bot

Selenium bot for Nike Snkrs site
The Unlicense
843 stars 290 forks source link

Failed Purchase #50

Open gesseekur opened 3 years ago

gesseekur commented 3 years ago

Not sure if I am missing something in particular but the bot stopped/failed on "Submit Order" - I am using firefox.

This error message might of help: 2021-01-08 07:01:03,013 [PID 22807] [Thread 4636188096] [ERROR] [root] Failed visibility check for Submit Button: Message: Traceback (most recent call last): File "/Users/Snkrs-Bot/main.py", line 527, in poll_checkout_phase_one check_submit_button(driver=driver, xpath_o=xpath) File "/Users/Snkrs-Bot/main.py", line 474, in check_submit_button wait_until_clickable(driver, xpath=xpath, duration=.2) File "/Users/Snkrs-Bot/main.py", line 580, in wait_until_clickable WebDriverWait(driver, duration, frequency).until(EC.element_to_be_clickable((By.XPATH, xpath))) File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message: 2021-01-08 07:01:03,014 [PID 22807] [Thread 4636188096] [INFO] [root] Too many iterations through checkout element check. Terminating check... 2021-01-08 07:01:03,014 [PID 22807] [Thread 4636188096] [INFO] [root] Purchase failed

Now that I read back on it, it seems to have failed visibility checks for Address, Shipping and payment as well but those seem to have gone through since it just failed at Submit Order. I pulled in the latest changes and would love any advice on how to fix this! (I am completely new at python)

mnai01 commented 3 years ago

What is the command/params you executed to run the script?

gesseekur commented 3 years ago

thanks for your response @mnai01 , here you go! python3 main.py --username username --password pw --url https://www.nike.com/launch/t/air-force-1-07-craft-mantra-orange --shoe-size 11 --driver-type firefox --shoe-type M --dont-quit --cvv cvv --release-time "2021-01-06 07:00:00" --shipping-option STANDARD --purchase

mnai01 commented 3 years ago

It looks like this problem is coming from the most recent PR. A polling system was implemented by @alfredog1976 to check what elements appear first during the checkout and I assume the problem might be coming from there. Possibly the constant SUBMIT_BUTTON_XPATH is different on the page you were on. Testing will have to be done to see if this is the problem but I will need to run it myself during a drop. Next time if you can run the command with --html-path as a param to save the HTML source then I can check to see if indeed the XPATHS were different, in addition, I can check any other theories.

gesseekur commented 3 years ago

yes i can definitely do that! thanks!

J420C commented 3 years ago

thanks gesseekur I learned how to run from your setup

gesseekur commented 3 years ago

@J420C youre welcome!

gesseekur commented 3 years ago

@mnai01 could you give me an example of how the html path should look like ? Do I just set up an empty html file and use that?

gesseekur commented 3 years ago

@J420C were you ever able to purchase any shoes ?

J420C commented 3 years ago

@gesseekur no & didn't have opportunity to run today I will run tomorrow see if I can it usually goes to cvv step but doesn't add cvv ¯_(ツ)_/¯

gesseekur commented 3 years ago

@J420C Ive had this issue before, usually if you use an account that already made a purchase with that card before then it will bypass that..if not maybe try entering it yourself ...but it may not be quick enough

Johvonny commented 3 years ago

if someone has an example of the solution you need id love to see it

Zaydo123 commented 3 years ago

if someone has an example of the solution you need id love to see it

I haven't looked at the source or anything, but someone should make a fork with a set browser user agent, as it should prevent there from being multiple different sites depending on the operating system or other things.