如何单击python selenium上的RECT

2024-05-14 22:23:04 发布

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

我试了很多次。。。但一切都不是

我想用python selenium在这个站点上单击"RECT"

你能帮我吗

**我的代码**

WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//*[@id='ez_canvas']/svg/rect[101]"))).click()

<&书信电报;目标HTML>&燃气轮机

<div id="ez_canvas" style="width: 682px; height: 602px;"><svg height="602" version="1.1" width="682" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="overflow: hidden; position: relative; background-color: rgb(244, 244, 244);" viewBox="0 0 520 520" preserveAspectRatio="xMidYMid meet"><image x="0" y="0" width="520" height="520" preserveAspectRatio="none" xlink:href="https://cdnticket.melon.co.kr/resource/image/upload/seat/2019/11/20191101152457ff3aa7a1-3231-45ba-b966-7995c6150ab3.svg" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></image><desc style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);">Created with Raphaël 2.1.2</desc><defs style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></defs><rect x="51.303463203463195" y="96.77460317460313" width="106" height="171" rx="0" ry="0" fill="none" stroke="#000" stroke-width="0" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></rect>

我想选“矩形”。。救命啊


Tags: svgrectimageidstyletapwidthcolor

热门问题