1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Join our Telegram chat: https://t.me/a_parser_en
    Dismiss Notice

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:
    160
    Likes Received:
    26
    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:
    3,792
    Likes Received:
    1,951
    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:
    160
    Likes Received:
    26
    That fixed it. Thanks.
     

Share This Page