繁体   English   中英

如何使用 selenium 和 python 单击包含 href 属性的元素

[英]How to click on element including href attribute using selenium and python

 <a ng-click="pageNavCtrl.executeCallback(item.callback, item.callbackArgs, $event)" ng-href="https://commerce.spscommerce.com/fulfillment/transactions/list/" translate-attr-title="fulfillment.pageNavLink.transactions" translate="fulfillment.pageNavLink.transactions" translate-default="Transactions" href="https://commerce.spscommerce.com/fulfillment/transactions/list/" title="Transactions"><span>Transactions</span></a>

我正在使用 python 和 selenium 来自动化 web 报告。 我尝试了不同的 find_element_by 选项,但都没有奏效。

在这种情况下,我正在尝试从仪表板转移到事务。

在此处输入图像描述

driver.find_element_by_xpath('//a[contains(@href,"https://commerce.spscommerce.com/fulfillment/transactions/list/")]')

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM