如何选择'开始'按钮,并点击它从下面的HTML代码。
我想使用下面的python-selenium
库
比如:
driver.find_element_by_xpath('//div[contains(@class,"box enter")'
'and text() = "start"]').click()
HTML代码
<section class="LandingPageView shown" style="display: block;">
<div class="background"></div>
<div class="gradient"></div>
<div class="page" style="opacity: 1;">
<div class="background asset background-homepage"></div>
<div class="just-reflektor-link" style="width: 312.289575px; height: 381.447127941177px; right: 25.635%;"></div>
<div class="content" style="right: -14.3125px; margin-left: 0px; transform: scale(1); -webkit-transform: scale(1);">
<div class="hero-logo"></div>
<p class="title"><bdo dir="ltr">A virtual projection<br>by Vincent Morisset</bdo></p>
<button class="box enter" dir="" style="transform: scale(1.001); -webkit-transform: scale(1.001);"><bdo dir="ltr">Start</bdo></button>
<p class="error-browser other" dir=""><bdo dir="ltr">Your web browser is not <br>supported by this experience. <br>Please try again using <a href="https://www.google.com/chrome">Google Chrome</a>.</bdo></p>
<p class="error-browser ff" dir=""><bdo dir="ltr">For the best performance, <br>we recommend <a href="https://www.google.com/chrome">Google Chrome</a>.</bdo></p>
</div>
<div class="link mouse-mode" dir=""><bdo dir="ltr">*No phone? <a>Use your mouse</a>.</bdo></div>
</div>
</section>
我不擅长xpath,但是为什么不使用css选择器呢?你知道吗
下面是如何通过
XAPTH
找到元素。你知道吗相关问题 更多 >
编程相关推荐