具有特定网址的href的选择器

时间:2019-05-30 22:40:44

标签: puppeteer codeceptjs

您如何选择具有特定网址的href元素?

这是我的要素:

def word5(wlist, n=5):
    return sum((int(len(word) == n) for word in wlist))

我尝试过I.click('新问题')和I.click(“ div [href $ ='/ test / issues / new']”)),但失败,并显示<a href="/test/issues/new" class="btn btn-primary float-right" role="button" data-hotkey="c" data-skip-pjax=""> New issue </a>

1 个答案:

答案 0 :(得分:0)

您尝试单击div元素"div[href$='/test/issues/new']",但在讨论中涉及a元素。

"a[href$='/test/issues/new']"上更改