您如何选择具有特定网址的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>
答案 0 :(得分:0)
您尝试单击div元素"div[href$='/test/issues/new']"
,但在讨论中涉及a
元素。
在"a[href$='/test/issues/new']"
上更改