[英]How to get an element that has no ID with node.js nightmare
我最近開始使用噩夢,但是在獲取沒有ID或其他信息的信息時遇到了問題,例如,我有以下HTML代碼:
<input type="submit" value="Login" name="reg">
這是一個按鈕,我如何才能在噩夢中對其單擊.click()
?
使用CSS屬性選擇器( https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors ):
document.querySelector('input[name=reg]');
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.