【问题标题】:Cannot find the css selector, method or element error using Selenium and Python使用 Selenium 和 Python 找不到 css 选择器、方法或元素错误
【发布时间】:2023-04-04 12:36:01
【问题描述】:

<div class="dijitReset dijitInline dijitMenuItemLabel cpNavLeftLink dijitMenuItemSelected dijitMenuItem" data-dojo-attach-point="focusNode" role="menuitem" tabindex="-1" data-dojo-attach-event="onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick" aria-labelledby="dijit_PopupMenuBarItem_2_text" id="dijit_PopupMenuBarItem_2" aria-disabled="false" widgetid="dijit_PopupMenuBarItem_2" aria-haspopup="true" style="">*
    <span data-dojo-attach-point="containerNode" id="dijit_PopupMenuBarItem_2_text">Carload Tools</span>
</div>

我正在尝试使用 selenium 访问以下元素,但由于某种原因,它说他们无法识别此元素,请帮忙。我的代码在其他元素上运行良好,但对于这个它无法找到元素。

【问题讨论】:

标签:
python-3.x
selenium
xpath
css-selectors
webdriverwait