代码之家  ›  专栏  ›  技术社区  ›  Swapnil Kotwal

在Gatling中可以遍历HTM标记并提取值吗?

  •  0
  • Swapnil Kotwal  · 技术社区  · 6 年前

    我在找一个内置的 gatling 在这条线上 https://groups.google.com/forum/#!topic/gatling/WIGH_nYw-Mg

    <li> </li> ,下面呈现的标记 <ul class="product_list grid row"> <li> 项目在页面上动态呈现?

    <ul class="product_list grid row">
     <li class="ajax_block_product col-xs-12 col-sm-6 col-md-4 first-in-line first-item-of-tablet-line first-item-of-mobile-line" style="height: auto; margin-bottom: 0px;"></li>
     <li class="ajax_block_product col-xs-12 col-sm-6 col-md-4 last-item-of-tablet-line" style="height: auto; margin-bottom: 0px;"></li>
     <li class="ajax_block_product col-xs-12 col-sm-6 col-md-4 last-in-line first-item-of-tablet-line last-item-of-mobile-line" style="height: auto; margin-bottom: 0px;"></li>
     <li class="ajax_block_product col-xs-12 col-sm-6 col-md-4 first-in-line last-line last-item-of-tablet-line first-item-of-mobile-line last-mobile-line"></li>
     <li class="ajax_block_product col-xs-12 col-sm-6 col-md-4 last-line first-item-of-tablet-line last-mobile-line">
    </ul>
    
    1. 然后,从每个 <li> ,我想提取 product_img_link product-price 价值观

    <li class="ajax_block_product col-xs-12 col-sm-6 col-md-4 first-in-line first-item-of-tablet-line first-item-of-mobile-line" style="height: auto; margin-bottom: 0px;"> <div class="product-container" itemscope="" itemtype="http://schema.org/Product"> <div class="left-block"> <div class="product-image-container"> <a class="product_img_link" href="http://automationpractice.com/index.php?id_product=3&amp;controller=product" title="Printed Dress" itemprop="url"> <img class="replace-2x img-responsive" src="http://automationpractice.com/img/p/8/8-home_default.jpg" alt="Printed Dress" title="Printed Dress" width="250" height="250" itemprop="image"> </a> <div class="content_price" itemprop="offers" itemscope="" itemtype="http://schema.org/Offer"> <span itemprop="price" class="price product-price"> $26.00 </span></div> </div> </div> </div> <!-- .product-container> --> </li>

    我在下面试过了 check 但没有帮助

    .check(regex("""<ul class="product_list grid row"> (.*) <!-- .product-container> -->""").findAll.saveAs("""ul_list""")))
    
    0 回复  |  直到 6 年前