Search code examples
pythonseleniumchromium

How do I input text automatically with python selenium?


I know these method element.send_keys('txt') and driver.execute_script("arguments[0].setAttribute('value', 'txt')", email).

I tried both of them.
But, I couldn't input the text. I think that following site controls input by javascript.
https://login.account.rakuten.com/sso/authorize?client_id=affiliate_jp_web&redirect_uri=https://affiliate.rakuten.co.jp/auth/callback&response_type=code&scope=openid&ui_locales=ja-JP&state=https%3A%2F%2Faffiliate.rakuten.co.jp#/sign_in

In this case, is it possible to input the text in any other way?


Solution

  • I can do through driver.find_element(By.XPATH, '//input[@name='username']').send_keys('test')

    enter image description here