如何使用Python selenium驱动程序在Microsoft CRM窗体上选择名为<input id=“lastname\u I”…>的Last Name元素?

2024-04-19 07:02:24 发布

您现在位置:Python中文网/ 问答频道 /正文

我不知道为什么我的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>

Tags: div脚本id元素inputgetbyhtml