Need javascript disabled on one page, and enabled on another

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.

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.

Need javascript disabled on one page, and enabled on another

by vidim on Wed Feb 01, 2017 6:05 pm

Hi all.
Running iMacros 10.0.2 on Windows 7.

I am making good money with iMacros since years back (thanks iOpus) but sometimes one wishes to smooth out ones workflow to be even more productive. In trying to do this, I have encountered a problem.

I am visiting a page. On this page, Javascript definitely needs to be turned off, cause Javascript introduces some new tags that must not be scraped, yet are absolutely impossible to de-select using any combination of wildcards, since they are for all html code intents and purposes identical to the tags that I wish to scrape.

Then there is a second page where Javascript needs to be turned on, cause something I wish to scrape is obfuscated unless a Javascript link is clicked.

I currently run this with a 2-step process. I run macro 1 with JS turned off, then I run macro 2 with JS turned on. This works fine, but I'd rather make it perfect.

The pages are on the same root domain, but in different directories. One is domain.com/userprofile/zyz, the other type is domain.com/dir/qwerty

Now if the settings of zones in IE could be custom made in an advanced fashion with wildcards, this would be easy to solve. But Microsoft does not allow me to disable JS on domain.com/userprofile, while allowing JS on domain.com/dir/*

Are there any other ways of setting advanced permissions in IE based on directories and wildcards?

Any other ideas? Grateful for anything that might push me the right way.

FYI, I run these macros tens of thousands of loops per day. So stability is important.
vidim
 
Posts: 23
Joined: Mon Nov 17, 2014 9:10 am

Re: Need javascript disabled on one page, and enabled on ano

by chivracq on Wed Feb 01, 2017 8:18 pm

vidim wrote:Hi all.
Running
Code: Select all
iMacros 10.0.2 on Windows 7.


I am making good money with iMacros since years back (thanks iOpus) but sometimes one wishes to smooth out ones workflow to be even more productive. In trying to do this, I have encountered a problem.

I am visiting a page. On this page, Javascript definitely needs to be turned off, cause Javascript introduces some new tags that must not be scraped, yet are absolutely impossible to de-select using any combination of wildcards, since they are for all html code intents and purposes identical to the tags that I wish to scrape.

Then there is a second page where Javascript needs to be turned on, cause something I wish to scrape is obfuscated unless a Javascript link is clicked.

I currently run this with a 2-step process. I run macro 1 with JS turned off, then I run macro 2 with JS turned on. This works fine, but I'd rather make it perfect.

The pages are on the same root domain, but in different directories. One is domain.com/userprofile/zyz, the other type is domain.com/dir/qwerty

Now if the settings of zones in IE could be custom made in an advanced fashion with wildcards, this would be easy to solve. But Microsoft does not allow me to disable JS on domain.com/userprofile, while allowing JS on domain.com/dir/*

Are there any other ways of setting advanced permissions in IE based on directories and wildcards?

Any other ideas? Grateful for anything that might push me the right way.

FYI, I run these macros tens of thousands of loops per day. So stability is important.

1- Okay..., a bit skeptical about the "absolutely impossible to de-select using any combination of wildcards" part, there is always a way to manage to extract/isolate only the Data that you want with (a Combination of) "Slim" Tagging (=> specific Attribute(s) Def), Relative Positioning + Tagging at some higher Level with 'EXTRACT=HTM' + 'EVAL()' to "clean" the Data...
There is always a "Pattern" within certain dynamic Limits and it's always possible to make your Macro dynamically adapt to it...
Willing to have a look if I can access the Site myself... (I will then slick my 3x "always" in public if I don't find a Solution, ah-ah...! :oops: )

2- But OK, going your "path" otherwise now, with Macro_1 + Macro_2, you could use some AHK Macro to switch JavaScript ON/OFF between the 2 Macros but you need the 'EVENT' Mode to be able to launch it but the 'EVENT' Mode is only available from v11 for iMB/IE.

3- A similar Solution could be used on FF with 2 different FF Profiles, one with JS enabled and the other one not, and some '.BAT' File to switch between the 2 Macros/Profiles using some FF Add-on called 'External Application Buttons' (requires 'EVENT' Mode as well).

4/4a- Still on FF with the 2 Profiles, but can maybe(?) be used on IE if you can have 2 IE Instances running at the same time, one with JS enabled and the other one not, I think that "Setting" is Profile-wide on FF, and then with for each Profile its own Macro_1 or Macro_2 running/looping simultaneously but always waiting for the other one (to start/finish) and communicating with each other using some Temp '.TXT' File (or maybe even 2 Temp Files) with Timestamp and some relevant Info about which one is "busy" at some point while the other one has to wait.
I use that Technique myself for a few of my Macros, usually to communicate with themselves between 2 Runs or between 2 Loops within a same Run to "dynamically" decide how many times they need to loop and to compute some Stats for some Logging and some Report displayed at the end...
5/4b- Instead of using a (local) Temp File, it's possible to use the OS Clipboard, but hum, always dangerous in my Opinion..., if you use the Computer in the meantime and want to do any Copy&Paste, you screw the "Communication" between the 2 Macros, ah-ah...!
For extra Reliability, the whole Process could be killed/restarted every Hour from the OS Task Scheduler...
Last edited by chivracq on Thu Feb 02, 2017 11:51 am, edited 1 time in total.
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6474
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Need javascript disabled on one page, and enabled on ano

by vidim on Thu Feb 02, 2017 11:01 am

Thanks chivracq, you trooper you.

No time to experiment right now, but will be back in a couple of days and report on my progress, if any.
vidim
 
Posts: 23
Joined: Mon Nov 17, 2014 9:10 am

Re: Need javascript disabled on one page, and enabled on ano

by chivracq on Thu Feb 02, 2017 12:04 pm

vidim wrote:Thanks chivracq, you trooper you.

No time to experiment right now, but will be back in a couple of days and report on my progress, if any.

Ah-ah, LOL...!! :twisted:

OK, take your time, but honestly all 2-5 Suggestions (I've added Numbers to my previous Post btw..., for easier Ref if needed...) are a bit cumbersome in my Opinion, even if I remember "recommending" Nb_4 already for some other Thread, from pfff..., maybe 2 years ago, and I don't remember exactly 100% for sure, but I think the User went for it...

As mentioned already, I would be willing to have a look at your Site to find some Solution for Nb_1 which is I think, still the best way, and I'm usually quite "Creative" in those funny/interesting/challenging Cases, to come up with a Solution that would work on IE (as FF, well iMacros for FF is my favorite Flavour of iMacros, ah-ah...!) if you don't really have the time in the coming days... I can be reached at [My_Pseudo_on_the_Forum]@gmail.com if you want to "communicate" Off-Forum... But I would need full Access to the Site I guess, with all Info/Requirements, especially what can possibly be changing between different Pages/Runs etc...
(And don't worry, your "good money" is safe, I "do it" for the "Challenge", I always like "tricky" Cases, ah-ah...!)
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6474
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to General Support & Discussions

Who is online

Users browsing this forum: No registered users and 7 guests

-->