How to extract link ?

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
newmember
Posts: 20
Joined: Mon Mar 17, 2014 7:01 am

How to extract link ?

Post by newmember » Fri Jun 03, 2016 2:09 pm

Hello,
I want to get link from 2 website
1.

Code: Select all

<figure class="user-card js-folders-user-card" data-user-id="1367491462">
 <div class="user-card__img">  
 <a href="/profile/01367491462?from_search=1&p=4&folder=25" class="b-link user-card__link app js-folders-user-profile-link" target="_blank" rel="profile-view"></a>  
How to get user id (1367491462) in above code. I used this code but not work.

Code: Select all

TAG POS=1 TYPE=DIV ATTR=CLASS:user-card__img EXTRACT=HREF
2.
<div class="tw3-card__avatar">
<a href="/147617602?r=search_v3_all&p=0" class="noline tw3-card__avatar__link jsSearchV3AvatarLinkTrigger jsShowOnboardingCard ">
Please help me. Thank you very much !
----------------------------------------
Below is my imacros information:
1. What version of iMacros are you using?
VERSION BUILD=8970419 RECORDER=FX

2. What operating system are you using? (please also specify language)
Windows 7 Ultimate x64

3. Which browser(s) are you using? (include version numbers)
Firefox 46.0.1

4. Do the included demo macros work ok?
Yes
chivracq
Posts: 9186
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to extract link ?

Post by chivracq » Fri Jun 03, 2016 4:41 pm

newmember wrote:Hello,
I want to get link from 2 website
1.

Code: Select all

<figure class="user-card js-folders-user-card" data-user-id="1367491462">
 <div class="user-card__img">  
 <a href="/profile/01367491462?from_search=1&p=4&folder=25" class="b-link user-card__link app js-folders-user-profile-link" target="_blank" rel="profile-view"></a>  
How to get user id (1367491462) in above code. I used this code but not work.

Code: Select all

TAG POS=1 TYPE=DIV ATTR=CLASS:user-card__img EXTRACT=HREF
2.
<div class="tw3-card__avatar">
<a href="/147617602?r=search_v3_all&p=0" class="noline tw3-card__avatar__link jsSearchV3AvatarLinkTrigger jsShowOnboardingCard ">
Please help me. Thank you very much !
----------------------------------------
Below is my imacros information:
1. What version of iMacros are you using?
VERSION BUILD=8970419 RECORDER=FX

2. What operating system are you using? (please also specify language)
Windows 7 Ultimate x64

3. Which browser(s) are you using? (include version numbers)
Firefox 46.0.1

4. Do the included demo macros work ok?
Yes
You can try extracting Custom Attributes but I think I remember trying myself and it doesn't work on iMacros for FF, but I must have tried on my Fav FCI (iMacros for FF v8.8.2, Pale Moon v26.1.1 (=FF43), Win7-x64/Win10-x64), so you may want to give it a try on iMacros for FF v8.9.7.

But the Data you want will be present in the 'EXTRACT=HTM' and you can then isolate it with 'EVAL()' and a Double 'split()'.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
techimac
Posts: 313
Joined: Fri Feb 20, 2015 9:27 pm

Re: How to extract link ?

Post by techimac » Fri Jun 03, 2016 8:24 pm

TAG POS=1 TYPE=A ATTR=href:*/profile/* EXTRACT=HREF

can use replace if link part is same for all
or split & replace
newmember
Posts: 20
Joined: Mon Mar 17, 2014 7:01 am

Re: How to extract link ?

Post by newmember » Sat Jun 04, 2016 6:06 am

Thank you for helping me, chivracq and techimac

Code: Select all

TAG POS=1 TYPE=A ATTR=href:*/profile/* EXTRACT=HREF
This works like a charm :)
Post Reply