Home > OS >  AttributeError: 'str' object has no attribute 'RETURN'
AttributeError: 'str' object has no attribute 'RETURN'

Time:02-22

Selenium webdriver _Python error

I'm getting an error for the below code :

Browser.find_element_by_css_selector('....').send_keys(NextDateformated.RETURN)

All I want to do is click enter/return/submit after I send my keys (variable - NextDateformatted) but it is failing and throwing an error as

'Str' object has no attribute 'Return'.I tried using enter and submit too. But it's failing here.

Can someone pls assist me on this?

CodePudding user response:

Instead of

Browser.find_element_by_css_selector('....').send_keys(NextDateformated.RETURN)

Try this

Browser.find_element_by_css_selector('....').send_keys(NextDateformated   Keys.RETURN)

Or this

Browser.find_element_by_css_selector('....').send_keys(NextDateformated   Keys.ENTER)
  • Related