在 C# selenium 中单击此按钮
Clicking this button in C# selenium
如何在 C# 中单击 selenium 中的这个特定按钮
我尝试了 a 标签,但它不起作用
<a class="btn-primary" href="http://myjunkyard.co.za/confirm" itemprop="url" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 16px; color: #FFF; text-decoration: none; line-height: 2em; font-weight: bold; text-align: center; cursor: pointer; display: inline-block; border-radius: 30px; background-color: #201D19; margin: 0; padding: 5px 30px;" target="_blank">Confirm email address</a>
您可以尝试使用此 XPath 定位元素:
"//a[contains(@href,'http://myjunkyard.co.za/confirm')]"
或者这个
"//a[text()='Confirm email address']"
如何在 C# 中单击 selenium 中的这个特定按钮
我尝试了 a 标签,但它不起作用
<a class="btn-primary" href="http://myjunkyard.co.za/confirm" itemprop="url" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 16px; color: #FFF; text-decoration: none; line-height: 2em; font-weight: bold; text-align: center; cursor: pointer; display: inline-block; border-radius: 30px; background-color: #201D19; margin: 0; padding: 5px 30px;" target="_blank">Confirm email address</a>
您可以尝试使用此 XPath 定位元素:
"//a[contains(@href,'http://myjunkyard.co.za/confirm')]"
或者这个
"//a[text()='Confirm email address']"