I want to create an automatic creation for Nike accounts. For that I need to add a phone number. I am coding with Python 3, Selenium and the Chrome Webdriver. This is my current code:
driver.get('https://www.nike.com/de/member/settings')
element2 = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "/html/body/div[3]/div/div[6]/div[2]/div[2]/div/form/div[2]/div[5]/div/div/div/div[2]/button")))
driver.execute_script("arguments[0].click();", element2)
time.sleep(1)
This codes only works sometimes, I am often getting this error message:
Traceback (most recent call last):
File "C:/Users/Marten/PycharmProjects/NikeSNKRS/main.py", line 239, in <module>
element2 = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "/html/body/div[3]/div/div[6]/div[2]/div[2]/div/form/div[2]/div[5]/div/div/div/div[2]/button")))
File "C:\Users\Marten\PycharmProjects\NikeSNKRS\venv\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
Do you maybe know a way to fix this? If you want to inspect the page, I created an account for you with which you can go onto the site and inspect the site. Click to go to Site
Account credentials:
Mail: eXrWi9TfA5XSfNcu4uv2q1@peter.de
Password: 5By3oq1Bw
I want to click this button: