杭州做网站的好公司有哪些,wordpress 高亮,上海建设工程招标,济南j建设网我们想从接口中提取一些想用的东西#xff0c;不习惯用正则提取器和json提取器#xff0c;今天我们来介绍下边界提取器#xff0c;相对前者较简单些。它通过左右边界来提取需要的内容#xff0c;它可以匹配任何格式的内容#xff0c;如文本、json、xpath、html等等#x…我们想从接口中提取一些想用的东西不习惯用正则提取器和json提取器今天我们来介绍下边界提取器相对前者较简单些。它通过左右边界来提取需要的内容它可以匹配任何格式的内容如文本、json、xpath、html等等使用也很简单分别填写要提取内容的左右边界即可很灵活
一、添加边界提取器
线程组—添加—后置处理器—边界提取器 二、使用边界提取器提取百度响应中百度一下你就知道
!DOCTYPE html !--STATUS OK--html headmeta http-equivcontent-type contenttext/html;charsetutf-8meta http-equivX-UA-Compatible contentIEEdgemeta contentalways namereferrerlink relstylesheet typetext/css hrefhttp://s1.bdstatic.com/r/www/cache/bdorz/baidu.min.csstitle百度一下你就知道/title/head body link#0000cc div idwrapper div idhead div classhead_wrapper div classs_form div classs_form_wrapper div idlg img hidefocustrue src//www.baidu.com/img/bd_logo1.png width270 height129 /div form idform namef action//www.baidu.com/s classfm input typehidden namebdorz_come value1 input typehidden nameie valueutf-8 input typehidden namef value8 input typehidden namersv_bp value1 input typehidden namersv_idx value1 input typehidden nametn valuebaiduspan classbg s_ipt_wrinput idkw namewd classs_ipt value maxlength255 autocompleteoff autofocus/spanspan classbg s_btn_wrinput typesubmit idsu value百度一下 classbg s_btn/span /form /div /div div idu1 a hrefhttp://news.baidu.com nametj_trnews classmnav新闻/a a hrefhttp://www.hao123.com nametj_trhao123 classmnavhao123/a a hrefhttp://map.baidu.com nametj_trmap classmnav地图/a a hrefhttp://v.baidu.com nametj_trvideo classmnav视频/a a hrefhttp://tieba.baidu.com nametj_trtieba classmnav贴吧/a noscript a hrefhttp://www.baidu.com/bdorz/login.gif?loginamp;tplmnamp;uhttp%3A%2F%2Fwww.baidu.com%2f%3fbdorz_come%3d1 nametj_login classlb登录/a /noscript scriptdocument.write(a hrefhttp://www.baidu.com/bdorz/login.gif?logintplmnu encodeURIComponent(window.location.href (window.location.search ? ? : ) bdorz_come1) nametj_login classlb登录/a);/script a href//www.baidu.com/more/ nametj_briicon classbri styledisplay: block;更多产品/a /div /div /div div idftCon div idftConw p idlh a hrefhttp://home.baidu.com关于百度/a a hrefhttp://ir.baidu.comAbout Baidu/a /p p idcpcopy;2017nbsp;Baidunbsp;a hrefhttp://www.baidu.com/duty/使用百度前必读/anbsp; a hrefhttp://jianyi.baidu.com/ classcp-feedback意见反馈/anbsp;京ICP证030173号nbsp; img src//www.baidu.com/img/gs.gif /p /div /div /div /body /html
三、边界提取器设置
Apply to 选Main sample only
要检查的响应字段 选主体
引用名称 提取出来参数引用的名称 param
Left Boundary提取值左边界 title
Right Boundary提取值右边界 /title
匹配数字 0随机1个 1取第1个 1 四、添加Debug Sampler测试是否提取成功 五、提取出来的值当作参数传参给其它采样器