Skip #EANF#

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
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
User321
Posts: 1
Joined: Wed Feb 26, 2014 8:01 pm

Skip #EANF#

Post by User321 » Wed Feb 26, 2014 8:09 pm

Hello. I use iMacros with Firefox to extract text from one webpage and post it to another. Sometimes I receive #EANF# instead of proper text. I know that this is some kind of error code but I do not need it. Is there any way to skip #EANF# or change it to some understandable text not stopping the entire script? I do not want it to be posted.
chivracq
Posts: 9507
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Skip #EANF#

Post by chivracq » Thu Feb 27, 2014 9:13 am

Mention your Configuration with all Versions when posting a Question...

Use EVAL() with replace().
- (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...
frankhack1
Posts: 83
Joined: Fri Mar 20, 2009 9:12 pm

Re: Skip #EANF#

Post by frankhack1 » Mon Mar 30, 2015 11:39 pm

Hi

How can I replace the #EANF# with just a space?

After the extracting, what will be next step?

Info:
FireFox PaleMoon 24.6.2 (x86)
iMacros 8.8.2
Windows 7
chivracq
Posts: 9507
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Skip #EANF#

Post by chivracq » Tue Mar 31, 2015 12:02 am

frankhack1 wrote:Hi

How can I replace the #EANF# with just a space?

After the extracting, what will be next step?

Info:
FireFox PaleMoon 24.6.2 (x86)
iMacros 8.8.2
Windows 7
There is no difficulty at all, that's just a standard 'EVAL()' and 'replace()':

Code: Select all

SET MyExtract EVAL("var s='{{!EXTRACT}}'; var x=s.replace('#EANF#', ' '); x:")
SET !EXTRACT {{MyExtract}}
(Not tested...)
- (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...
frankhack1
Posts: 83
Joined: Fri Mar 20, 2009 9:12 pm

Re: Skip #EANF#

Post by frankhack1 » Sun May 10, 2015 5:18 pm

Hi again.

But I'm using the .js macros.

So how do I put that formula inside .js? I copied the code you provided and it gave me errors.

I tried like this after I did the extraction of the content:

Code: Select all

var macros;
    macros =  "CODE:";
macros += "SET MyExtract EVAL("var s='{{!EXTRACT}}'; var x=s.replace('#EANF#', ' '); x:")" + "\n";
macros += "SET !EXTRACT {{MyExtract}}" + "\n";
iimPlay(macros)
Also tried to changes to take out the " and the ' from the code but couldn't manage to make it work
ZmanZoo
Posts: 21
Joined: Mon Feb 16, 2015 8:24 pm

Re: Skip #EANF#

Post by ZmanZoo » Sun May 10, 2015 8:09 pm

can you look at this post http://forum.imacros.net/viewtopic.php?f=11&t=19759 and see if Tom, Tech Supports' response helps your issue?
chivracq
Posts: 9507
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Skip #EANF#

Post by chivracq » Tue May 12, 2015 8:57 pm

frankhack1 wrote:Hi again.

But I'm using the .js macros.

So how do I put that formula inside .js? I copied the code you provided and it gave me errors.

I tried like this after I did the extraction of the content:

Code: Select all

var macros;
    macros =  "CODE:";
macros += "SET MyExtract EVAL("var s='{{!EXTRACT}}'; var x=s.replace('#EANF#', ' '); x:")" + "\n";
macros += "SET !EXTRACT {{MyExtract}}" + "\n";
iimPlay(macros)
Also tried to changes to take out the " and the ' from the code but couldn't manage to make it work
ZmanZoo wrote:can you look at this post http://forum.imacros.net/viewtopic.php?f=11&t=19759 and see if Tom, Tech Supports' response helps your issue?
Yep, I think the "Troll Specialist :roll: " is right, you need to (once/double/triple...?) escape the >"< (and maybe the >'< as well...) in the 'EVAL()' Statement...

But from the scarce Info you provided, I don't see the need to use a .js Script with a Macro generated on the fly instead of a pure .iim Macro...
I find it very cumbersome to want to use the JavaScript 'replace()' Statement interpreted in the 'EVAL()' Statement interpreted in the on the fly Macro.

Another Solution would be, because 'replace()' is already a JavaScript Statement, to do it directly in your .js Script and to pass it (back) to your Macro as an Argument using any Name other than '!EXTRACT' because '!EXTRACT' is reset when you call (again) 'iimPlay()'... But in my Opinion, it's still making things complicated when then can be simple. :roll:
- (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...
Post Reply