1

I have this code:

website code

Enter Username or Email

elem = driver.find_element_by_id("id_username")
elem.send_keys(user)

Enter Password

elem = driver.find_element_by_id("id_password")
elem.send_keys(pwd)

Login

driver.find_elements_by_xpath("//*[contains(text(), 'Autentificare')]")
keyboard.press(Key.enter)
keyboard.release(Key.enter)

I can't manage to get this login info sent in order to login on platform

Please help

Thank you

2

driver.find_elements_by_xpath("//*[contains(text(), 'Autentificare')]") will return a list, unnecessarily.

Probably you need to find the submit button and press it.

driver.find_element_by_css_selector("button[type='submit']").click()

or

driver.find_element_by_css_selector("button[type='submit']").send_keys(Keys.ENTER)
  • Thank you. it works. – Alex Alex Mar 22 at 13:05
  • 1
    @AlexAlex, please accept this answer if it's solved your problem :) – trashpanda Mar 22 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.