Google Parser - Extract Link and Domain

Discussion in 'A-Parser Support Forum' started by scrapefun, May 26, 2022.

  1. scrapefun

    scrapefun A-Parser Enterprise License
    A-Parser Enterprise

    Joined:
    Feb 24, 2015
    Messages:
    184
    Likes Received:
    34
    I'm trying to extract the domain name from Google Parser $link variable. I've managed to get it working but the 1st result domain is not being extracted.

    Instead, 2nd result domain is placed first. It is like the first result is being skipped.

    [​IMG]

    Here is what I have for result format:

    [​IMG]
     
  2. Support

    Support Administrator
    Staff Member A-Parser Enterprise

    Joined:
    Mar 16, 2012
    Messages:
    4,557
    Likes Received:
    2,167
    The array element numbers start at 0, and there is also a $loop.index variable.
    Use loop.index instead of loop.count when accessing an array of domains.
    Code:
    [% d.${loop.index}.domain %]
     
    scrapefun likes this.
  3. scrapefun

    scrapefun A-Parser Enterprise License
    A-Parser Enterprise

    Joined:
    Feb 24, 2015
    Messages:
    184
    Likes Received:
    34
    That fixed it. Thanks.
     

Share This Page