【发布时间】:2022-01-19 01:01:51
【问题描述】:
我正在尝试使用 selenium 自动下载报告。要访问报告所在的页面,我必须单击带有此代码的图像
<div class="leaflet-marker-icon single-icon-container running hover asset leaflet-zoom-hide leaflet-clickable" tabindex="0" style="margin-left: -22px; margin-top: -41px; width: 44px; height: 44px; opacity: 1; transform: translate3d(525px, 238px, 0px); z-index: 238;"><div class="icon-value" lid="219058"></div></div>
我试过了
wtg = driver.find_elements_by_class_name(
"leaflet-marker-icon single-icon-container running hover asset leaflet-zoom-hide leaflet-clickable")
wtg.click()
但什么也没发生。
有 7 个元素具有相同的类,并且唯一的“id”看起来像 lid="219058",但我不知道如何选择它。
【问题讨论】:
标签: python selenium selenium-webdriver css-selectors selenium-chromedriver