【发布时间】:2019-11-30 04:29:24
【问题描述】:
我正在使用 Postman 来自动化一些测试。 我需要在名为“execution”的隐藏字段上获取value属性的值:
<form class="app-form" method="post" id="fm1" action="login" _lpchecked="1">
<input type="hidden" name="execution" value="633ffc0f">
</form>
在邮递员中,只有 Cheerio 可用于此。 我尝试了以下变体,但没有一个有效:
$('input#execution').attr("value");
$('input[name=execution]').attr("value");
$('input[type=hidden]').attr("value");
$(':hidden#execution').attr("value");
$('input:hidden[name=execution]').attr("value");
非常感谢!
【问题讨论】:
标签: javascript html postman cheerio