0
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: [name="current_password"]

It says this even though the name of the current password field is "current_password" on the Twitter password reset page.

cruisepandey
  • 28,520
  • 6
  • 20
  • 38

1 Answers1

0

I am at this page

https://twitter.com/account/reset_password

and I see a couple of input boxes with following HTML

<input id="password" class="Form-textbox Edge-textbox is-required" type="password" name="password" data-username="cruisepandey" ,="" data-fullname="Cruise Pandey">

and

<input class="Form-textbox Edge-textbox" type="password" name="password_confirmation">

then you can use the below code to send the keys

wait = WebDriverWait(driver, 30)
wait.until(EC.visibility_of_element_located((By.CSS_SELECTOR, "input#password"))).send_keys('Enter your new password here')

Imports:

from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC

I did not get the current_password input box at my end, but you can follow the same way to get the job done.

cruisepandey
  • 28,520
  • 6
  • 20
  • 38
  • what about this page: https://twitter.com/settings/password – atomic-coder Nov 21 '21 at 07:03
  • it asked for my login, once I provided it is asking for a password, were you intended to interact with that page ? I see this CSS selector `input[name='password']` which is unique and should work with the above technique. – cruisepandey Nov 21 '21 at 07:06