On instagram you can use the Account center to change your password:
From there you can choose change password option to change your password in this screen:
I'm trying using selenium to fill the input boxes and click the Change password "button" (It's not a button) with no success.
I can fill the inputs without any issue but for the button I have tried 2 different approaches with same results
1 - Selecting the span that contains the text "Change password" and then clicking it. This closes the change password dialog but no password is changed
2 - Moving to the span (have tried some parents too) and then clicking it. Same result as before.
Here the code:
print("Filling change password data")
currentPassowrd= driver.find_element(By.XPATH, "//label[contains(text(),'Current password')]/preceding-sibling::input")
newPassowrd = driver.find_element(By.XPATH, "//label[text()='New password']/preceding-sibling::input")
reNewPassowrd = driver.find_element(By.XPATH, "//label[text()='Re-type new password']/preceding-sibling::input")
changePasswordButton = driver.find_element(By.XPATH, "//span[text()='Change password']")
ActionChains(driver) \
.move_to_element(currentPassowrd).click() \
.send_keys("old pass") \
.move_to_element(newPassowrd).click() \
.send_keys("new pass") \
.move_to_element(reNewPassowrd).click() \
.send_keys("re new pass") \
.perform()
time.sleep(3);
ActionChains(driver).click(changePasswordButton).perform()