Extract a part of a TITLE and open it in a url?

2019-03-06 23:03发布

I'm using iMacros.

Inspect Element show me this:

<a class="avatar " title="designperks's Instagram Profile" alt="designperks's Instagram Profile" href="/app/users/ig-1451494389/designperks/photos"

What I want to do is extract what's in TITLE until the apostrophe and open it in instagram.com, in this example it's designperks here is what I came up with:

SET !ERRORIGNORE YES
SET !EXTRACT_TEST_POPUP NO
SET !TIMEOUT_STEP 2
TAB T=1
TAG POS={{!LOOP}} TYPE=A ATTR=TITLE:* EXTRACT=TITLE
SET !VAR1 EVAL("var s=\"{{!EXTRACT}}\"; s.split(\"'\",\"\"); ")
SET !EXTRACT NULL
SET !EXTRACT {{!VAR1}}
TAB OPEN
TAB T=2
URL GOTO=http://instagram.com/{{!VAR1}}

I'm almost done, but I know that there is a mistake here (\"'\",\"\"); ") and I can't figure it out.

Many thanks!

2条回答
爷、活的狠高调
2楼-- · 2019-03-06 23:46

you could use jQuery.

$().ready(function() {
    alert($(".avatar").attr("title"));  
);

But I'm not sure if that's 'imactos' relevant.

查看更多
forever°为你锁心
3楼-- · 2019-03-06 23:54

How could I always extract the 4th element in HREF?

HREF:/app/users/*/*/photos
查看更多
登录 后发表回答