XPath取XML标签attribute的值--fiddler应用

原文
目的:使用Fiddler请求代替OA系统一个个的手动点单操作。因为家加载太慢。

步骤:

  1. 使用Fiddler抓包,分析点单提交所需参数。

XPath取XML标签attribute的值--fiddler应用_第1张图片

2,分析请求只需要调整POST的参数requestid,此参数是要提交单据的请求id

3,从系统查询页面抓包,并用Xpath取到requestid

<table isPageAutoWrap="0" instanceid="workflowRequestListTable" pageId="" tabletype="checkbox" pagesize="100" page="true" recordCount="14" pagenum="1" nowpage="1" orderValue="t2.receivedate ,t2.receivetime " countColumns="" orderType="DESC" havaOprates="true" operatesWidth="100px">
    <head>
        <col width="3%" key="true" text="<input name=_allselectcheckbox type=checkbox onClick=checkAllChkBox(this.checked)>" type="checkbox" id="checkbox" popedompara="column:workflowid+column:isremark+column:requestid+column:nodeid+column:userid" showmethod="weaver.general.WorkFlowTransMethod.getWFSearchResultCheckBox" />
        <col width="19%" display="true" text="请求标题" column="requestname" orderkey="t1.requestname" linkkey="requestid" linkvaluecolumn="requestid" target="_fullwindow" transmethod="weaver.general.WorkFlowTransMethod.getWfNewLinkWithTitle" otherpara="column:requestid+column:workflowid+column:viewtype+0+7+column:nodeid+column:isremark+738174+column:agentorbyagentid+column:agenttype+column:isprocessed+column:userid" pkey="requestname+weaver.general.WorkFlowTransMethod.getWfNewLinkWithTitle" systemid="60276" />
        <col width="6%" display="true" text="创建人" column="creater" orderkey="t1.creater" otherpara="column:creatertype" transmethod="weaver.general.WorkFlowTransMethod.getWFSearchResultName" systemid="48242" />
        <col width="8%" display="true" id="createdate" text="创建日期" column="createdate" orderkey="t1.createdate,t1.createtime" otherpara="column:createtime" transmethod="weaver.general.WorkFlowTransMethod.getWFSearchResultCreateTime" systemid="48267" />
        <col width="15%" display="true" text="未操作者" column="requestid" otherpara="7+738174+column:userid" transmethod="weaver.general.WorkFlowTransMethod.getUnOperators" systemid="58278" />
    head>
    <row rowClick="">
        <col text="" type="checkbox" linkvalue="13145920" />
        <col width="19%" display="true" text="请求标题" column="requestname" orderkey="t1.requestname" linkkey="requestid" linkvaluecolumn="requestid" target="_fullwindow" transmethod="weaver.general.WorkFlowTransMethod.getWfNewLinkWithTitle" otherpara="column:requestid+column:workflowid+column:viewtype+0+7+column:nodeid+column:isremark+738174+column:agentorbyagentid+column:agenttype+column:isprocessed+column:userid" pkey="requestname+weaver.general.WorkFlowTransMethod.getWfNewLinkWithTitle" systemid="60276" linkvalue="13145920" value="SAP发起送签OA回写ECN异常:SPLM007-ECN变更通知单-孙时锋-2020-05-08-单号:SECN-20200508-0018-单号ID:13136401-系统管理员-2020-05-08">SAP发起送签OA回写ECN异常:SPLM007-ECN变更通知单-孙时锋-2020-05-08-单号:SECN-20200508-0018-单号ID:13136401-系统管理员-2020-05-08]]>col>
        <col width="6%" display="true" text="创建人" column="creater" orderkey="t1.creater" otherpara="column:creatertype" transmethod="weaver.general.WorkFlowTransMethod.getWFSearchResultName" systemid="48242" linkvalue="1" value="1">系统管理员]]>col>
        <col width="8%" display="true" id="createdate" text="创建日期" column="createdate" orderkey="t1.createdate,t1.createtime" otherpara="column:createtime" transmethod="weaver.general.WorkFlowTransMethod.getWFSearchResultCreateTime" systemid="48267" linkvalue="2020-05-08" value="2020-05-08">col>
        <col width="15%" display="true" text="未操作者" column="requestid" otherpara="7+738174+column:userid" transmethod="weaver.general.WorkFlowTransMethod.getUnOperators" systemid="58278" linkvalue="13145920" value="13145920">显示
]]>col> <operates async="false" _md5="039E498A4BCCDFD79402517B3DA24F34"> <operate href="javascript:doReadIt();" otherpara="738174" text="标记为已读" index="0" value="13145920" _indexId="index_0" async="false" /> <operate href="javascript:doReview();" otherpara="738174" text="转发" index="1" value="13145920" _indexId="index_1" async="false" /> <operate href="javascript:doPrint();" otherpara="738174" text="打印" index="2" value="13145920" _indexId="index_2" async="false" /> <operate href="javascript:doNewwf();" text="新建流程" otherpara="1+0" index="3" value="13145920" _indexId="index_3" async="false" /> <operate href="javascript:seeFormLog();" text="表单日志" otherpara="2" index="5" value="13145920" _indexId="index_4" async="false" /> operates> row> ..... ..... table>

4,Xpath取requestid值,Xpath表表达式://col[@type='checkbox']/@linkvalue。在线测试地址FreeFormmatter

XPath取XML标签attribute的值--fiddler应用_第2张图片

5,将requestid放到fiddler的post地址参数中,执行。

XPath取XML标签attribute的值--fiddler应用_第3张图片

6,查看执行结果

XPath取XML标签attribute的值--fiddler应用_第4张图片

你可能感兴趣的:(XML,Xpath,fiddler)