pcomputo / Whole-Foods-Delivery-Slot

Automated script for Whole Foods and Amazon Fresh delivery slot
Apache License 2.0
443 stars 149 forks source link

What could cause this issue-in autoCheckout #39

Closed Bhavnak13 closed 4 years ago

Bhavnak13 commented 4 years ago

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[5]/div[1]/div/div[2]/div/div/div/div/div[1]/div[4]/div[2]/div/div[4]/div/div/ul/li/span/span/div/div[2]/span/span/button"} (Session info: chrome=80.0.3987.163)

pcomputo commented 4 years ago

You'd probably have to increase the sleep time. Make it to 10-12. Everyone has varying internet speeds and load times.

Bhavnak13 commented 4 years ago

Actually I get this message SLOTS OPEN! 'say' is not recognized as an internal or external command, operable program or batch file. Traceback (most recent call last): File "whole_foods_delivery_autobuy.py", line 125, in getWFSlot('https://www.amazon.com/gp/buy/shipoptionselect/handlers/display.html?hasWorkingJavascript=1') File "whole_foods_delivery_autobuy.py", line 108, in getWFSlot autoCheckout(driver) File "whole_foods_delivery_autobuy.py", line 24, in autoCheckout slot_select_button = driver.find_element_by_xpath('/html/body/div[5]/div[1]/div/div[2]/div/div/div/div/div[1]/div[4]/div[2]/div/div[4]/div/div/ul/li/span/span/div/div[2]/span/span/button') File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 394, in find_element_by_xpath return self.find_element(by=By.XPATH, value=xpath) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 978, in find_element 'value': value})['value'] File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[5]/div[1]/div/div[2]/div/div/div/div/div[1]/div[4]/div[2]/div/div[4]/div/div/ul/li/span/span/div/div[2]/span/span/button"} (Session info: chrome=80.0.3987.163)

Bhavnak13 commented 4 years ago

Does that mean slot_select_button = driver.find_element_by_xpath('/html/body/div[5]/div[1]/div/div[2]/div/div/div/div/div[1]/div[4]/div[2]/div/div[4]/div/div/ul/li/span/span/div/div[2]/span/span/button') These html tags are incorrect that's why message is : no such element: Unable to locate ?

pcomputo commented 4 years ago

for the say error please refer to the FAQ section in Readme. for the html, time.sleep(6), try to increase it to 10