theriley106 / SneakerBotTutorials

Open Source SneakerBot created as a supplement to my "Creating a Sneaker Bot in Python" Youtube Series
https://www.youtube.com/playlist?list=PL3fpqcQTK0f9sACDQstvjxbHzD1L_gr__
MIT License
621 stars 137 forks source link

Unable to find element by ID #14

Open nickcanarelli opened 6 years ago

nickcanarelli commented 6 years ago

I dont get it. I'm running this in a virtualenv. Pulling all of your requirements, etc... Yet im still getting errors. Initially when running it, it opens but doesnt pull up Amazon. I set the geckodriver.exe executable path and now im getting an error saying its not finding the element by id....

Traceback (most recent call last): File "testingCookies.py", line 29, in <module> driver.find_element_by_id("add-to-cart-button").click() File "/Users/developer/Desktop/SneakerBot/venv/yeezy2/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 269, in find_element_by_id return self.find_element(by=By.ID, value=id_) File "/Users/developer/Desktop/SneakerBot/venv/yeezy2/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 752, in find_element 'value': value})['value'] File "/Users/developer/Desktop/SneakerBot/venv/yeezy2/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute self.error_handler.check_response(response) File "/Users/developer/Desktop/SneakerBot/venv/yeezy2/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: {"errorMessage":"Unable to find element with id 'add-to-cart-button'","request":{"headers":{"Accept":"application/json","Accept-Encoding":"identity","Connection":"close","Content-Length":"99","Content-Type":"application/json;charset=UTF-8","Host":"127.0.0.1:54525","User-Agent":"Python-urllib/2.7"},"httpVersion":"1.1","method":"POST","post":"{\"using\": \"id\", \"sessionId\": \"c111fa40-e19f-11e7-9e15-6b2466416670\", \"value\": \"add-to-cart-button\"}","url":"/element","urlParsed":{"anchor":"","query":"","file":"element","directory":"/","path":"/element","relative":"/element","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/element","queryKey":{},"chunks":["element"]},"urlOriginal":"/session/c111fa40-e19f-11e7-9e15-6b2466416670/element"}} Screenshot: available via screen

anthr76 commented 6 years ago

I'm getting the same thing