F12调试页面,如何定位参数

JQuery元素定位

1.输入"$",查看页面是否支持JQuery元素定位,若是不支持,则使用documen.querySelecttor('Input');html

2.使用$('#username').length 查看元素username的个数;post

3d

3.使用$('input[name=lt]').val()获取到It值htm

 

4.在postman使用html界面定位到元素:blog

如:input

const $ = cheerio.load(responseBody); //调用cheerio方法,获取到responseBodyio

console.log($('input[name=lt]').val());console

pm.globals.set("lt", $('input[name=lt]').val());postman

5.cheerio方法的使用,参考:https://cheerio.js.org/这个库方法

相关文章
相关标签/搜索