Following JS based links

Discussions and Tech Support related to the iMacros Google Chrome extension.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Following JS based links

by pangaea on Wed Oct 11, 2017 11:15 am

So I am trying to get iMacros to follow a link like this: <a href="#" onclick=(javascript code that sends you to another URL)>(stuff)</a>

So is there any way to do this? Perhaps to extract the onclick code and make it execute somehow?
pangaea
 
Posts: 1
Joined: Wed Oct 11, 2017 11:08 am

Re: Following JS based links

by iimfun on Mon Oct 16, 2017 11:52 pm

Yes. This way may help
Code: Select all
SET !EXTRACT_TEST_POPUP NO
TAG POS=1 TYPE=A ATTR=TXT:"(stuff)" EXTRACT=HTM
SET onClick EVAL("'{{!EXTRACT}}'.match(/onclick="(.+?)"/)[1];")
URL GOTO=javascript:{{onClick}}

or even this one
Code: Select all
TAG POS=1 TYPE=A ATTR=TXT:"(stuff)"
iimfun
 
Posts: 239
Joined: Tue Jul 19, 2016 6:06 am


Return to iMacros for Chrome

Who is online

Users browsing this forum: No registered users and 5 guests

-->