Replies: 3 comments · 10 replies
-
意思是嵌套循环么? |
Beta Was this translation helpful? Give feedback.
All reactions
-
顺丰速运 app,完成任务需要一个参数,但领取任务奖励需要三个参数, 循环完成和领取奖励 我是嵌套了三个 for 循环,但是会提示 请求 limit,估计是循环次数太多了,有没有更简便的方法,请帮忙修改,并提交一下公开模版? |
Beta Was this translation helpful? Give feedback.
All reactions
-
顺丰速运 (1).har.zip |
Beta Was this translation helpful? Give feedback.
All reactions
-
我看了一下似乎并没有嵌套循环?此外我看到header中有一个 signature 字段,且每个请求的值均不同,这个应该是变量么? |
Beta Was this translation helpful? Give feedback.
All reactions
-
Beta Was this translation helpful? Give feedback.
All reactions
-
是的 这个已经通过/g解决了。 循环内的变量不能重复赋值吗? 第一次循环cycle 通过正则接口取到值,第二次cycle通过正则接口取到值 但是cycle还是第一次的值 |
Beta Was this translation helpful? Give feedback.
All reactions
-
发一下去掉隐私信息后的har吧 |
Beta Was this translation helpful? Give feedback.
All reactions
-
Beta Was this translation helpful? Give feedback.
All reactions
-
抱歉一直没有注意到你的回复,我测试了一下是没有问题的 参考: [{"comment":"访问首页","request":{"method":"GET","url":"https://console.upyun.com/login/?from=https%3A%2F%2Fwww.upyun.com%2FonePiece","headers":[{"name":":authority","value":"console.upyun.com"},{"name":":method","value":"GET"},{"name":":path","value":"/login/?from=https://www.upyun.com/onePiece"},{"name":":scheme","value":"https"},{"name":"accept","value":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"},{"name":"accept-encoding","value":"gzip, deflate, br, zstd"},{"name":"accept-language","value":"zh-CN,zh;q=0.9"},{"name":"cache-control","value":"no-cache"},{"name":"pragma","value":"no-cache"},{"name":"referer","value":"https://www.upyun.com/onePiece"},{"name":"sec-ch-ua","value":"\"Google Chrome\";v=\"123\", \"Not:A-Brand\";v=\"8\", \"Chromium\";v=\"123\""},{"name":"sec-ch-ua-mobile","value":"?0"},{"name":"sec-ch-ua-platform","value":"\"Windows\""},{"name":"sec-fetch-dest","value":"document"},{"name":"sec-fetch-mode","value":"navigate"},{"name":"sec-fetch-site","value":"same-site"},{"name":"sec-fetch-user","value":"?1"},{"name":"upgrade-insecure-requests","value":"1"},{"name":"user-agent","value":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"}],"cookies":[]},"rule":{"success_asserts":[{"re":"200","from":"status"}],"failed_asserts":[],"extract_variables":[]}},{"comment":"登录","request":{"method":"POST","url":"https://console.upyun.com/accounts/signin/","headers":[{"name":":authority","value":"console.upyun.com"},{"name":":method","value":"POST"},{"name":":path","value":"/accounts/signin/"},{"name":":scheme","value":"https"},{"name":"accept","value":"application/json, text/plain, */*"},{"name":"accept-encoding","value":"gzip, deflate, br, zstd"},{"name":"accept-language","value":"zh-CN,zh;q=0.9"},{"name":"cache-control","value":"no-cache"},{"name":"content-type","value":"application/json"},{"name":"origin","value":"https://console.upyun.com"},{"name":"pragma","value":"no-cache"},{"name":"referer","value":"https://console.upyun.com/login/?from=https:%2F%2Fwww.upyun.com%2FonePiece"},{"name":"sec-ch-ua","value":"\"Google Chrome\";v=\"123\", \"Not:A-Brand\";v=\"8\", \"Chromium\";v=\"123\""},{"name":"sec-ch-ua-mobile","value":"?0"},{"name":"sec-ch-ua-platform","value":"\"Windows\""},{"name":"sec-fetch-dest","value":"empty"},{"name":"sec-fetch-mode","value":"cors"},{"name":"sec-fetch-site","value":"same-origin"},{"name":"user-agent","value":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"}],"cookies":[],"data":"{\"username\":\"{{username}}\",\"password\":\"{{password}}\",\"from\":\"https://www.upyun.com/onePiece\"}","mimeType":"application/json"},"rule":{"success_asserts":[{"re":"200","from":"status"}],"failed_asserts":[],"extract_variables":[{"name":"mobile","re":"\"mobile\"\\s*:\\s*\"(\\d+)\"","from":"content"},{"name":"accountName","re":"\"username\"\\s*:\\s*\"([^\"]+)\"","from":"content"},{"name":"__log__","re":"","from":"content"}]}},{"comment":"每日签到","request":{"method":"POST","url":"https://console.upyun.com/activity/signin","headers":[{"name":":authority","value":"console.upyun.com"},{"name":":method","value":"POST"},{"name":":path","value":"/activity/signin"},{"name":":scheme","value":"https"},{"name":"accept","value":"application/json, text/plain, */*"},{"name":"accept-encoding","value":"gzip, deflate, br, zstd"},{"name":"accept-language","value":"zh-CN,zh;q=0.9"},{"name":"cache-control","value":"no-cache"},{"name":"origin","value":"https://www.upyun.com"},{"name":"pragma","value":"no-cache"},{"name":"referer","value":"https://www.upyun.com/onePiece"},{"name":"sec-ch-ua","value":"\"Google Chrome\";v=\"123\", \"Not:A-Brand\";v=\"8\", \"Chromium\";v=\"123\""},{"name":"sec-ch-ua-mobile","value":"?0"},{"name":"sec-ch-ua-platform","value":"\"Windows\""},{"name":"sec-fetch-dest","value":"empty"},{"name":"sec-fetch-mode","value":"cors"},{"name":"sec-fetch-site","value":"same-site"},{"name":"user-agent","value":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"}],"cookies":[]},"rule":{"success_asserts":[{"re":"200","from":"status"}],"failed_asserts":[],"extract_variables":[{"name":"signinResult","re":"\"msg\":\"([^\"]*)\"","from":"content"}]}},{"comment":"获取每日任务列表","request":{"method":"GET","url":"https://console.upyun.com/activity/tasks","headers":[{"name":":authority","value":"console.upyun.com"},{"name":":method","value":"GET"},{"name":":path","value":"/activity/tasks"},{"name":":scheme","value":"https"},{"name":"accept","value":"application/json, text/plain, */*"},{"name":"accept-encoding","value":"gzip, deflate, br, zstd"},{"name":"accept-language","value":"zh-CN,zh;q=0.9"},{"name":"cache-control","value":"no-cache"},{"name":"origin","value":"https://www.upyun.com"},{"name":"pragma","value":"no-cache"},{"name":"referer","value":"https://www.upyun.com/onePiece"},{"name":"sec-ch-ua","value":"\"Google Chrome\";v=\"123\", \"Not:A-Brand\";v=\"8\", \"Chromium\";v=\"123\""},{"name":"sec-ch-ua-mobile","value":"?0"},{"name":"sec-ch-ua-platform","value":"\"Windows\""},{"name":"sec-fetch-dest","value":"empty"},{"name":"sec-fetch-mode","value":"cors"},{"name":"sec-fetch-site","value":"same-site"},{"name":"user-agent","value":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"}],"cookies":[]},"rule":{"success_asserts":[{"re":"200","from":"status"}],"failed_asserts":[],"extract_variables":[{"name":"taskList","re":"/\\{[^{}]*\\}/g","from":"content"},{"name":"task","re":"\\{[^{}]*\\}","from":"content"}]}},{"comment":"For 循环开始","request":{"method":"GET","url":"{% for task in taskList %} ","headers":[],"cookies":[],"data":""},"rule":{"success_asserts":[],"failed_asserts":[],"extract_variables":[]}},{"comment":"获取cycle的值","request":{"method":"POST","url":"api://util/regex","headers":[],"cookies":[],"data":"p=%22cycle%22%5Cs*%3A%5Cs*%22(%5B%5E%22%5D%2B)%22&data={{task}}"},"rule":{"success_asserts":[{"re":"200","from":"status"},{"re":"\"状态\": \"OK\"","from":"content"}],"failed_asserts":[],"extract_variables":[{"name":"cycle","re":"\"1\": \"(.*)\"","from":"content"}]}},{"comment":"获取mileage的值","request":{"method":"POST","url":"api://util/regex","headers":[],"cookies":[],"data":"p=%22mileage%22%5Cs*%3A%5Cs*(%5Cd%2B)&data={{task}}"},"rule":{"success_asserts":[{"re":"200","from":"status"},{"re":"\"状态\": \"OK\"","from":"content"}],"failed_asserts":[],"extract_variables":[{"name":"mileage","re":"\"1\": \"(.*)\"","from":"content"}]}},{"comment":"获取event_id的值","request":{"method":"POST","url":"api://util/regex","headers":[],"cookies":[],"data":"p=%22event_id%22%5Cs*%3A%5Cs*%22(%5B%5E%22%5D%2B)%22&data={{task}}"},"rule":{"success_asserts":[{"re":"200","from":"status"},{"re":"\"状态\": \"OK\"","from":"content"}],"failed_asserts":[],"extract_variables":[{"name":"eventId","re":"\"1\": \"(.*)\"","from":"content"}]}},{"comment":"获取finish的值","request":{"method":"POST","url":"api://util/regex","headers":[],"cookies":[],"data":"p=%22finish%22%5Cs*%3A%5Cs*(true%7Cfalse)&data={{task}}"},"rule":{"success_asserts":[{"re":"200","from":"status"},{"re":"\"状态\": \"OK\"","from":"content"}],"failed_asserts":[],"extract_variables":[{"name":"finish","re":"\"1\": \"(.*)\"","from":"content"}]}},{"comment":"Unicode转换","request":{"method":"POST","url":"api://util/unicode","headers":[],"cookies":[],"data":"html_unescape=false&content=null"},"rule":{"success_asserts":[{"re":"200","from":"status"},{"re":"\"状态\": \"200\"","from":"content"}],"failed_asserts":[],"extract_variables":[{"name":"message","re":"\"转换后\": \"(.*)\"","from":"content"}]}},{"comment":"判断是否为每日任务开始","request":{"method":"GET","url":"{% if cycle in ['weekly','dayly'] %}","headers":[],"cookies":[],"data":""},"rule":{"success_asserts":[],"failed_asserts":[],"extract_variables":[]}},{"comment":"判断finish开始","request":{"method":"GET","url":"{% if finish=='false' %}","headers":[],"cookies":[],"data":""},"rule":{"success_asserts":[],"failed_asserts":[],"extract_variables":[]}},{"comment":"排除掉的event_id开始","request":{"method":"GET","url":"{% if eventId!='FriendsHelp' %}","headers":[],"cookies":[],"data":""},"rule":{"success_asserts":[],"failed_asserts":[],"extract_variables":[]}},{"request":{"method":"OPTIONS","url":"https://console.upyun.com/activity/tasks","headers":[{"name":":authority","value":"console.upyun.com"},{"name":":method","value":"OPTIONS"},{"name":":path","value":"/activity/tasks"},{"name":":scheme","value":"https"},{"name":"accept","value":"*/*"},{"name":"accept-encoding","value":"gzip, deflate, br, zstd"},{"name":"accept-language","value":"zh-CN,zh;q=0.9"},{"name":"access-control-request-headers","value":"content-type,x-token"},{"name":"access-control-request-method","value":"POST"},{"name":"cache-control","value":"no-cache"},{"name":"origin","value":"https://www.upyun.com"},{"name":"pragma","value":"no-cache"},{"name":"referer","value":"https://www.upyun.com/onePiece"},{"name":"sec-fetch-dest","value":"empty"},{"name":"sec-fetch-mode","value":"cors"},{"name":"sec-fetch-site","value":"same-site"},{"name":"user-agent","value":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"}],"cookies":[]},"rule":{"success_asserts":[{"re":"204","from":"status"}],"failed_asserts":[],"extract_variables":[]}},{"comment":"执行每日任务","request":{"method":"POST","url":"https://console.upyun.com/activity/tasks","headers":[{"name":":authority","value":"console.upyun.com"},{"name":":method","value":"POST"},{"name":":path","value":"/activity/tasks"},{"name":":scheme","value":"https"},{"name":"accept","value":"application/json, text/plain, */*"},{"name":"accept-encoding","value":"gzip, deflate, br, zstd"},{"name":"accept-language","value":"zh-CN,zh;q=0.9"},{"name":"cache-control","value":"no-cache"},{"name":"content-type","value":"application/json"},{"name":"origin","value":"https://www.upyun.com"},{"name":"pragma","value":"no-cache"},{"name":"referer","value":"https://www.upyun.com/onePiece"},{"name":"sec-ch-ua","value":"\"Google Chrome\";v=\"123\", \"Not:A-Brand\";v=\"8\", \"Chromium\";v=\"123\""},{"name":"sec-ch-ua-mobile","value":"?0"},{"name":"sec-ch-ua-platform","value":"\"Windows\""},{"name":"sec-fetch-dest","value":"empty"},{"name":"sec-fetch-mode","value":"cors"},{"name":"sec-fetch-site","value":"same-site"},{"name":"user-agent","value":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"},{"name":"x-token","value":"7c4ee7db-d67e-4912-b72b-9e2439352716"}],"cookies":[],"data":"{\"event_id\":\"{{eventId}}\",\"accountName\":\"{{accountName}}\"}","mimeType":"application/json"},"rule":{"success_asserts":[{"re":"200","from":"status"}],"failed_asserts":[],"extract_variables":[{"name":"finish","re":"\\\"result\\\"\\:(\\w+)","from":"content"},{"name":"message","re":"\\\"message\\\"\\:\"(.*)\"","from":"content"}]}},{"comment":"延时3秒","request":{"method":"GET","url":"api://util/delay/{{random(3,5,1)}}","headers":[],"cookies":[],"data":""},"rule":{"success_asserts":[{"re":"200","from":"status"}],"failed_asserts":[],"extract_variables":[]}},{"comment":"排除掉的event_id结束","request":{"method":"GET","url":"{% endif %}","headers":[],"cookies":[],"data":""},"rule":{"success_asserts":[],"failed_asserts":[],"extract_variables":[]}},{"comment":"判断finish结束","request":{"method":"GET","url":"{% endif %}","headers":[],"cookies":[],"data":""},"rule":{"success_asserts":[],"failed_asserts":[],"extract_variables":[]}},{"comment":"判断是否为每日任务结束","request":{"method":"GET","url":"{% endif %}","headers":[],"cookies":[],"data":""},"rule":{"success_asserts":[],"failed_asserts":[],"extract_variables":[]}},{"comment":"Copy_icode转换ch","request":{"method":"POST","url":"api://util/unicode","headers":[],"cookies":[],"data":"html_unescape=false&content={{__log__}}cycle={{cycle}}, eventId={{eventId}}, mileage={{mileage}}, finish={{finish}}{% if message and message != 'null'%}, message={{message}}{% endif %}\\r\\n"},"rule":{"success_asserts":[{"re":"200","from":"status"},{"re":"\"状态\": \"200\"","from":"content"}],"failed_asserts":[],"extract_variables":[{"name":"__log__","re":"\"转换后\": \"(.*)\"","from":"content"}]}},{"comment":"For 循环结束","request":{"method":"GET","url":"{% endfor %}","headers":[],"cookies":[],"data":""},"rule":{"success_asserts":[]}},{"comment":"查看里程","request":{"method":"GET","url":"https://console.upyun.com/activity/mileage","headers":[{"name":":authority","value":"console.upyun.com"},{"name":":method","value":"GET"},{"name":":path","value":"/activity/mileage"},{"name":":scheme","value":"https"},{"name":"accept","value":"application/json, text/plain, */*"},{"name":"accept-encoding","value":"gzip, deflate, br, zstd"},{"name":"accept-language","value":"zh-CN,zh;q=0.9"},{"name":"cache-control","value":"no-cache"},{"name":"origin","value":"https://www.upyun.com"},{"name":"pragma","value":"no-cache"},{"name":"referer","value":"https://www.upyun.com/onePiece"},{"name":"sec-ch-ua","value":"\"Google Chrome\";v=\"123\", \"Not:A-Brand\";v=\"8\", \"Chromium\";v=\"123\""},{"name":"sec-ch-ua-mobile","value":"?0"},{"name":"sec-ch-ua-platform","value":"\"Windows\""},{"name":"sec-fetch-dest","value":"empty"},{"name":"sec-fetch-mode","value":"cors"},{"name":"sec-fetch-site","value":"same-site"},{"name":"user-agent","value":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"}],"cookies":[]},"rule":{"success_asserts":[{"re":"200","from":"status"}],"failed_asserts":[],"extract_variables":[{"name":"can_use","re":"\\\"canUse\\\"\\:(\\d+)","from":"content"},{"name":"used","re":"\\\"used\\\"\\:(\\d+)","from":"content"}]}},{"comment":"输出日志","request":{"method":"POST","url":"api://util/unicode","headers":[],"cookies":[],"data":"html_unescape=false&content={{__log__}}签到结果: {{signinResult}}\\r\\n用户名: {{accountName}}\\r\\n手机号: {{mobile}}\\r\\n可用里程: {{can_use}}\\r\\n已用里程: {{used}}"},"rule":{"success_asserts":[{"re":"200","from":"status"},{"re":"\"状态\": \"200\"","from":"content"}],"failed_asserts":[],"extract_variables":[{"name":"__log__","re":"\"转换后\": \"(.*)\"","from":"content"}]}}] |
Beta Was this translation helpful? Give feedback.
All reactions
-
好的 谢谢 |
Beta Was this translation helpful? Give feedback.
-
已通过前面的请求获取到三个变量,也通过 for 循环能够提交单个数组的循环请求,但有个请求中携带了三个变量,请问如何才能将三个数组变量进行循环提交?
在做顺丰快递的多任务模板,卡在了这里。
Beta Was this translation helpful? Give feedback.
All reactions