country = 'Brazil'
_id = 'countryDropdown-account_titleText'
identifier = "//input[@id='{}']".format(_id)
# Make sure it's not invisible
driver.execute_script("document.getElementById('{}').setAttribute('style','display: initial;')".format(_id), identifier)
# Clear the field
driver.find_element_by_xpath(identifier).clear()
driver.find_element_by_xpath(identifier).send_keys('{country}'.format(country=country))
正如@Peres995所指出的,您确实可以用文本填充字段,您只需选择输入字段。你知道吗
尝试:
相关问题 更多 >
编程相关推荐