Search code examples
facebookimacros

how to extract UID facebook using imacros


i have query like this :

<a href="https://www.facebook.com/marsfam.masakan?fref=gm&amp;hc_location=group_member_profile" data-hovercard="/ajax/hovercard/user.php?id=100021477465459&amp;extragetparams=%7B%22fref%22%3A%22gm%22%2C%22directed_target_id%22%3A361041810716193%2C%22hc_location%22%3A%22group_member_profile%22%7D" data-hovercard-prefer-more-content-show="1" aria-controls="js_ks" aria-haspopup="true" aria-describedby="js_kt" id="js_ku">Dapur Marsfam</a>

how to extract 100021477465459 using imacros

i use this tag pos but still error

TAG POS={{!LOOP}} TYPE=A ATTR=HREF:/?fref=pb EXTRACT=HREF


Solution

  • Try the following code:

    TAG POS={{!LOOP}} TYPE=A ATTR=data-hovercard:/ajax/hovercard/user.php?id=* EXTRACT=HTM
    SET UID EVAL("'{{!EXTRACT}}'.match(/\/ajax\/hovercard\/user\.php\?id=(\d+)/)[1];")
    PROMPT {{UID}}