【发布时间】:2020-01-26 15:48:33
【问题描述】:
我有以下几点:
<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;">
我想编辑值“mercendes”并将其更改为其他值。
到目前为止我尝试的是这样的:
browser.find_element_by_class_name("input-medium input-large form-control tt-input")
和
browser.find_element_by_css_selector("input.data-qa-id")
但它们都不起作用。
当然,一旦我抓住了元素,我希望我能做 send_keys()。但我的问题是我找不到元素。谢谢
【问题讨论】:
-
请将 html 代码作为文本发布,而不是作为图像发布
-
没用过python/selenium,但是,
find_element_by_class_name可能只需要一个类,你试过find_element_by_class_name('input-medium')吗? -
另外,我想说
find_element_by_css_selector()如果用作find_element_by_css_selector('input[data-qa-id]=""')会起作用(但不知道这是否会得到你需要的元素)