繁体   English   中英

如何选择具有该名称的Microsoft CRM表单上的Last Name元素 <input id = “lastname_i”…> 使用Python selenium驱动程序?

[英]How do I select the Last Name element on Microsoft CRM form that has the name <input id = “lastname_i”…> using Python selenium driver?

我不知道为什么我的CRM驱动程序没有在HTML元素下面捕获这个。 我尝试过使用绝对和相对XPath,尝试使用webdriver.get_element_by_id('lastname_i')get_element_by_css_selector('input.lastname_i')以及更多脚本编写的可能性。 无论出于何种原因,webdriver都找不到这个元素。

任何人都可以帮助我使用正确的Python脚本吗? 我认为这与我想要找到的HTML元素中没有/>的事实有关。

<div class="ms-crm-Inline-Edit  ms-crm-Inline-HasError"><input id="lastname_i" attrname="lastname" attrpriv="create, read, update" maxlength="50" title="" class="ms-crm-InlineInput" controlmode="alwaysedit" style="ime-mode: active;" aria-invalid="true" type="text"></div>

等待20秒,然后尝试以下代码。

webdriver.get_element_by_xpath("//input[@id='lastname_i']")

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM