Personal Snippet? 5 instead of 10 results to scrape from?

Discussion in 'A-Parser Support Forum' started by wp, May 31, 2018.

Tags:
  1. wp

    wp New Member

    Joined:
    May 31, 2018
    Messages:
    1
    Likes Received:
    0
    Would anyone be able to make a personal snippet to choose less then 10 results to scrape from? https://c2n.me/3UwXDGI
     
  2. Support

    Support Administrator
    Staff Member A-Parser Enterprise

    Joined:
    Mar 16, 2012
    Messages:
    4,557
    Likes Received:
    2,167
    Hello.
    You can use the Template Toolkit to output the required number of results:
    Code:
    [% FOREACH i IN [0..4];
        serp.$i.link _ "\n";
    END %]
    Or it is possible to output only the necessary elements of an array, referring to them directly:
    Code:
    $serp.0.link
    $serp.1.link
    $serp.2.link
    $serp.3.link
    $serp.4.link
    More details:
    https://en.a-parser.com/wiki/results-representation/
    https://en.a-parser.com/wiki/result-format/
    https://en.a-parser.com/wiki/template-toolkit/

    P.S. Please, log in with an account that has a license for A-Parser, because support is provided only to license holders.
     

Share This Page