解析HTMl POSTMAN响应

时间:2019-12-06 21:51:57

标签: javascript html automation postman

<script type="text/javascript">
            var zEncKeyFld = "AO-7DEABF";
    var zEncKeyVal = "jhdgdjgdjgdgkjdakjdahkdfskjhdfs7fddf6f/kI9i0Xt1P/BbvWCZxpzLvB1zRGHfPQ==";
    var zshowWF = true
        </script>

我尝试以下方法,但没有成功

responseHTML = cheerio(pm.response.text()); 
pzEncKeyVal = console.log(responseHTML.find('[/(?<=zEncKeyFld = ")(.*)(?=";)/]').val());
pzEncKeyFld = console.log(responseHTML.find(/(?<=zEncKeyVal = ")(.*)(?=";)/).val());
pzEncKeyVal1 = console.log(responseHTML.find('[var zEncKeyFld]').val());
pzEncKeyFld2= console.log(responseHTML.find('[var zEncKeyVal]').val());

 pm.globals.set("zEncKeyVal", pzEncKeyVal);
pm.globals.set("zEncKeyFld", pzEncKeyFld);

致谢

0 个答案:

没有答案