philippnormann / nvidia-sniper

🎯 Autonomously buy Nvidia Founders Edition GPUs as soon as they become available.
394 stars 99 forks source link

Alternate shipping caused order to fail #47

Closed WesSec closed 4 years ago

WesSec commented 4 years ago

During last drop. the sniper crashed because css wasn't properly loaded (probably due to server load), this caused the alternative shipping address to fail and make the script crash.

I would suggest a feature where alternative shipping is disabled, this would also speed up the bot as 99% will eventually use the same invoice as shipping address.

Trace of the crash

2020-10-01 20:06:22,670 nvidia-sniper: Checking out as guest...
2020-10-01 20:06:24,534 nvidia-sniper: Sent Pushover notification to ALL_DEVICES.
Traceback (most recent call last):
  File "/home/wessel/Desktop/nvidia-sniper/sniper/nvidia.py", line 140, in fill_out_form
    driver.find_element(By.ID, 'shippingName1').send_keys(
  File "/home/wessel/.local/share/virtualenvs/nvidia-sniper-iktqfT3h/lib/python3.8/site-packages/selenium/webdriver/remote/webelement.py", line 477, in send_keys
    self._execute(Command.SEND_KEYS_TO_ELEMENT,
  File "/home/wessel/.local/share/virtualenvs/nvidia-sniper-iktqfT3h/lib/python3.8/site-packages/selenium/webdriver/remote/webelement.py", line 633, in _execute
    return self._parent.execute(command, params)
  File "/home/wessel/.local/share/virtualenvs/nvidia-sniper-iktqfT3h/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/home/wessel/.local/share/virtualenvs/nvidia-sniper-iktqfT3h/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: Element <input id="shippingName1" name="SHIPPINGname1" type="text"> is not reachable by keyboard

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/wessel/Desktop/nvidia-sniper/sniper/__main__.py", line 254, in <module>
    loop.run_until_complete(main())
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/wessel/Desktop/nvidia-sniper/sniper/__main__.py", line 220, in main
    nvidia.checkout_guest(
  File "/home/wessel/Desktop/nvidia-sniper/sniper/nvidia.py", line 246, in checkout_guest
    fill_out_form(driver, timeout, customer)
  File "/home/wessel/Desktop/nvidia-sniper/sniper/nvidia.py", line 150, in fill_out_form
    WebDriverWait(driver, timeout).until(shipping_visible)
  File "/home/wessel/.local/share/virtualenvs/nvidia-sniper-iktqfT3h/lib/python3.8/site-packages/selenium/webdriver/support/wait.py", line 80, in until
    raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: 
WesSec commented 4 years ago

Thanks for this PR @krcm0209 !! This is a nice feature, using the fallback shipping speed does not solve the issue for alternative shipping address I think. An option to not check the "alternative shipping address" and not fill in the data would solve this.