0

I have the following:

enter image description here

<input data-qa-id="" lion-href-autocomplete="/merchant/assignable-user- 
autocomplete" class="input-medium input-large form-control tt-input" 
type="text" autocomplete="off" value="mercendes" spellcheck="false" 
dir="auto" style="position: relative; vertical-align: top; background-color: 
transparent;">

and I would like to edit the value "mercendes" and change it into something else.

What I tried so far is this:

browser.find_element_by_class_name("input-medium input-large form-control tt-input")

and

browser.find_element_by_css_selector("input.data-qa-id")

but none of them work.

Of course as soon as I grab the element I hope I can do send_keys(). But my problem is that I can not find the element. Thank you

Marios
  • 26,333
  • 8
  • 32
  • 52

2 Answers2

2

browser.find_element_by_class_name() only support single class name NOT multiple class name. Use following css selector.

browser.find_element_by_css_selector("input.input-medium.input-large.form-control.tt-input")

If you are looking for more unique css selector try that.

browser.find_element_by_css_selector("input.input-medium.input-large.form-control.tt-input[lion-href-autocomplete*='merchant']")
KunduK
  • 32,888
  • 5
  • 17
  • 41
0

You can try finding the element using XPath:

from selenium.webdriver.common.by import By

driver.find_element(By.XPATH, '//button[text()="Some text"]')
driver.find_elements(By.XPATH, '//button')

If you are using chrome, you can follow this question to find XPath of an element.