简体   繁体   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?

I have no clue why my CRM driver is not catching this below HTML element. 我不知道为什么我的CRM驱动程序没有在HTML元素下面捕获这个。 I have tried using absolute and relative XPath, tried using webdriver.get_element_by_id('lastname_i') , get_element_by_css_selector('input.lastname_i') , and many more scripting possibilities. 我尝试过使用绝对和相对XPath,尝试使用webdriver.get_element_by_id('lastname_i')get_element_by_css_selector('input.lastname_i')以及更多脚本编写的可能性。 For whatever reason, the webdriver does not find this element. 无论出于何种原因,webdriver都找不到这个元素。

Can anyone help me with the correct Python script? 任何人都可以帮助我使用正确的Python脚本吗? I think it has something to do with the fact there is no /> in the HTML element I am trying to find. 我认为这与我想要找到的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.

相关问题 我如何 select selenium 中没有 ID/text_link/name 的元素? - How do I select the an element without an ID/text_link/name in selenium? 如何通过Selenium / Python选择没有ID的Web元素 - How do I select a web element with no ID through Selenium/Python 如何选择具有此功能的 div - how do I select the div that has this <i> using Selenium python 如何使用Python驱动程序获取Cassandra集群的名称? - How do I get the name of a Cassandra cluster, using the Python driver? Selenium Web 驱动程序:如何单击没有 ID、NAME 的图像按钮 - Selenium Web driver: how do I click on image button without ID, NAME how do I select xpath image without a class name using selenium in python? - how do I select xpath image without a class name using selenium in python? 如何使用Python Selenium选择表中的元素? - How do I select an element within a table using Python Selenium? Select 输入元素按 id 使用 Selenium Python - Select input element by id using Selenium Python 如何使用panda加载具有文件夹名称和图像名称但不包含ID的数据集文件? - How do I load a dataset file that has folder name and image name but does not contain an id in python using panda? 如何使用Selenium chrome驱动程序按名称过滤网络呼叫条目? - How can I filter entries of network calls by name in Python using selenium chrome driver?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM