0

我有一个服务器应用程序来提交在 Browser 中运行良好的数据,我尝试为此创建一个 VuGe 脚本,该脚本使用 reg_save_param 函数检查来自服务器响应的模式,如下所示:

web_reg_save_param("gcid",
                         "LB=<span", 
                         "RB=</span>", 
                         LAST );

web_reg_save_param("X",
                       "LB={", 
                       "RB=}", 
                       LAST );  

, 但是模式 ie "gcid" 必须是一个字母数字值, 在响应中找不到, 而不是 , 它看起来像一个带有标签的 html 元素, 同样适用于 "X" 参数, 这是我得到的回应:

<!DOCTYPE html>\n
Action.c(144):     <html id="ng-app" ng-app="gcdm-cockpit">\n
Action.c(144):     <head>\n
Action.c(144):         <meta charset="utf-8">\n
Action.c(144):         <meta http-equiv="X-UA-Compatible" content="IE=edge">\n
Action.c(144):         <meta name="viewport" content="width=device-width, initial-scale=1.0">\n
Action.c(144):         <title>GCDM Cockpit</title>\n
Action.c(144):         <link rel="stylesheet" type="text/css" href="css/bootstrap.css" media="all"/>\n
Action.c(144):         <link rel="stylesheet" type="text/css" href="css/app.css" media="all"/>\n
Action.c(144):         <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awe
Action.c(144):     some.min.css">\n
Action.c(144):         <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->\n
Action.c(144):         <!--[if lt IE 9]>\n
Action.c(144):         <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>\n
Action.c(144):         <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>\n
Action.c(144):         <script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.2.0/es5-shim.min.js"></
Action.c(144):     script>\n
Action.c(144):         <![endif]-->\n
Action.c(144):         <!--[if lte IE 8]>\n
Action.c(144):         <script src="//cdnjs.cloudflare.com/ajax/libs/json3/3.3.0/json3.min.js"></script>\n
Action.c(144):         <![endif]-->\n
Action.c(144):     </head>\n
Action.c(144):     <body ng-controller="CockpitController">\n
Action.c(144):     \n
Action.c(144):         <div class="container-fluid" cockpit-app\n
Action.c(144):              cockpit-api-key="ddd"\n
Action.c(144):              cockpit-api-endpoint='{{ isLocalNonStubMode() ? "https://gcdm-cockpit-test.natura
Action.c(144):     .net/mon/" : "/mon/" }}'\n
Action.c(144):              cockpit-default-frame-endpoint="<%= defaultFrameEndpoint %>"\n
Action.c(144):              cockpit-portal-frame-endpoint="<%= portalFrameEndpoint %>">\n
Action.c(144):     \n
Action.c(144):     \n
Action.c(144):             <span cockpit-menu class="menu"></span>\n
Action.c(144):     \n
Action.c(144):             <div class="row">\n
Action.c(144):                 <div class="col-md-8">\n
Action.c(144):                     <div id="view" ng-view></div>\n
Action.c(144):                 </div>\n
Action.c(144):             </div>\n
Action.c(144):     \n
Action.c(144):         </div>\n
Action.c(144):     \n
Action.c(144):         <script type="text/javascript" src="js/d3.v3.4.8.min.js"></script>\n
Action.c(144):         <script type="text/javascript" src="js/gcdm-cockpit.js"></script>\n
Action.c(144):     \n
Action.c(144):     </body>\n
Action.c(144):     </html>\n
Action.c(144):     \n
Action.c(144): Notify: Saving Parameter "X =  isLocalNonStubMode() ? "https://gcdm-cockpit-test.natura.net/mon/" : "/mon/" ".
Action.c(144): Notify: Saving Parameter "gcid =  cockpit-menu class="menu">".

当我在浏览器(Firefox)上提交数据时,它工作正常,通过点击Firefox工具Page Inspector“检查元素”,我可以清楚地找到请求正文和响应正文,并且我可以找到我寻找的模式,我在 Vugen Script 上找不到

    Request-URL:    https://gcdm-cockpit-test.natura.net/mon/protected/api/v3/services/getUserGCID
Request-Methode:    POST
Status-Code:    HTTP/1.1 200 OK
Request-Header 11:23:52.000
username:   Tobias Testman
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0
Referer:    https://gcdm-cockpit-test.natura.net/
Pragma: no-cache
Host:   gcdm-cockpit-test.natura.net
Content-Type:   application/json;charset=utf-8
Content-Length: 85
Connection: keep-alive
Cache-Control:  no-cache
Authorization:  Basic dGVzdDp0ZXN0
Accept-Language:    de,en-US;q=0.7,en;q=0.3
Accept-Encoding:    gzip, deflate
Accept: application/json, text/plain, */*
Gesendetes Cookie
SMIDENTITY: CqZsbaL3sS1WZ7H4d1vj0T4eMwSuDQ1gPOxg152ARu1Fj0EojrK/g20mN82ILIbsJOH09ilJT88c4NxmiC1gMdHkPuGRvzs7UWAwwkZcUIW4wMQN+zm8N8ub1dMM+Yj8j8L/2GlDuOCqlpaQ4dkSzQE6e95gQA9Xb+nWPVX1RItGfQVkyMNqW1ruQdF3Me+RjVT7dsZh6yMn+O1JyGgM/Fm65sTdVpFYj+jVFMFJ4uWr8CoQTIdK+FpcouS1vpD/mXgSMUyT5tfRJkA+tN7Z+JE18acuPJ/Qb5j1cprT3Phac/G3fXCbL/1kkM67JfMuXrEfRpJQmgFh9brlpJfrRQV+uYH/RZ1fyvTRn2A4+1FLxOBDrLKhHFujiTFIFgE0QQjX0GRNGEfdfCf7Zx5LBqhYMhJWzW+01YvJEP5j3ZH5x1UK82JP6ln5g2l9STRZUvmhoSCnXySl7yaUan+6ICBkfVaDl9ZAw+1QLx4TlBz8CS9+P8PUa703YAZ5EosPVgZvHqUifLuaVyv7U2BFElRWlvdYQkbXtYLE3QWqUutiI4Q0828+OF5y/2HNFPiB324iwSarrBQqKsu/nbR2AtvlkGKmP/rLiQaXa/ii+e4A3ocPfPt5rAk5wjNwc2ShdrV/g0TsKrYIy2xJeXrwGoRkj+qqil2O
Request-Body
{"environment":"opint","userIdentifier":"gcdmtest_bp_pr_acc_po_00499@trash-mail.com"}
Response-Header Δ309ms
Transfer-Encoding:  chunked
Keep-Alive: timeout=5, max=100
Date:   Tue, 03 Nov 2015 10:23:52 GMT
Content-Type:   application/json;charset=UTF-8
Content-Encoding:   gzip
Connection: Keep-Alive
Response-Body Δ0ms
{"data":["1755c83a-9303-459a-a741-68131b439eb0"]}
4

1 回答 1

0

您的左边界和右边界条件不够明显,无法缩小到您要捕获的一项。将捕获的范围缩小到更清晰的边界。

此外,请确保将捕获标记放置在正确的位置,即要捕获元素的上方。web_reg_.. 系列函数就像一个筛子/过滤器,HTML 通过它传递,值留在过滤器中。

如果您需要 1755c83a-.... 的值,那么您应该查看带有"ORD=1"的"LB={\"data\":[\"" & "RB=\"]} "

于 2015-11-03T14:48:31.683 回答