CasperJS,无法点击按钮

时间:2016-11-16 06:14:32

标签: javascript jquery phantomjs casperjs

有些我无法点击模态窗口的Pull按钮。 以下是HTML代码:

<div class="modal-footer">
    <span class="btn btn-cancel">Cancel</span>
    <span class="btn btn-primary">Pull</span>
</div>

我尝试使用以下选项但仍然无法点击它

this.evaluate(function () {
    $('#div.modal-footer:nth-child(7) > span:nth-child(2)').click();
});

this.waitForSelector("#div.modal-footer:nth-child(7) > span:nth-child(2)").thenClick("#div.modal-footer:nth-child(7) > span:nth-child(2)");

使用xpath:

casper.click(x("//a[contains(text(), 'Pull')]"));

任何帮助将不胜感激

感谢

0 个答案:

没有答案
相关问题