EVAL If not returning value
Forum rules
iMacros EOL - Attention!
The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely,
The Progress Team
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
iMacros EOL - Attention!
The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely,
The Progress Team
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
EVAL If not returning value
TAG POS=1 TYPE=A ATTR=TXT:*offered* EXTRACT=TXT
SET key EVAL("var s='{{!EXTRACT}}'; var x; if(s!='#EANF#'){ x=\"YES\";} x")
prompt {{key}}
I am getting _undefined_ when text is extracted
need help fast
SET key EVAL("var s='{{!EXTRACT}}'; var x; if(s!='#EANF#'){ x=\"YES\";} x")
prompt {{key}}
I am getting _undefined_ when text is extracted
need help fast
Available for custom iim, javascript iMacros scripts
- thecoder2012
- Posts: 446
- Joined: Sat Aug 15, 2015 5:14 pm
- Location: Internet
- Contact:
Re: EVAL If not returning value
Website url or (full) html code? (full example)techimac wrote:TAG POS=1 TYPE=A ATTR=TXT:*offered* EXTRACT=TXT
I have no "__undefined__" in my tests with your script.techimac wrote:SET key EVAL("var s='{{!EXTRACT}}'; var x; if(s!='#EANF#'){ x=\"YES\";} x")
prompt {{key}}
I am getting _undefined_ when text is extracted
need help fast
Tested with iMacros 8.9.7, Win8.1 and Waterfox 55.
But why no "else"? Like:
Code: Select all
SET key EVAL("var s='{{!EXTRACT}}'; var x; if(s!='#EANF#'){ x=\"YES\";}else{x=\"\";}; x")
prompt {{key}}
Code: Select all
<a>mega offered thing</a>
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me!
Re: EVAL If not returning value
try this
TAG POS=1 TYPE=* ATTR=TXT:*offered* EXTRACT=TXT
SET key EVAL("var s='{{!EXTRACT}}'; var x; if(s!='#EANF#'){ x=\"YES\";} x")
prompt {{key}}
TAG POS=1 TYPE=* ATTR=TXT:*offered* EXTRACT=TXT
SET key EVAL("var s='{{!EXTRACT}}'; var x; if(s!='#EANF#'){ x=\"YES\";} x")
prompt {{key}}
Available for custom iim, javascript iMacros scripts
Re: EVAL If not returning value
can you fix this?
and
TAG POS=1 TYPE=* ATTR=TXT:*iphone* EXTRACT=txt seems to hang browser
set !errorignore yes
SET !TIMEOUT_PAGE 10
url goto=google.com
SET !TIMEOUT_PAGE 1
wait seconds=5
TAG POS=1 TYPE=* ATTR=TXT:*iphone* EXTRACT=txt
SET key EVAL("var s='{{!EXTRACT}}'; var x; if(s!='#EANF#'){ x=\"YES\";}else{x=\"\";}; x")
prompt {{key}}
and
TAG POS=1 TYPE=* ATTR=TXT:*iphone* EXTRACT=txt seems to hang browser
set !errorignore yes
SET !TIMEOUT_PAGE 10
url goto=google.com
SET !TIMEOUT_PAGE 1
wait seconds=5
TAG POS=1 TYPE=* ATTR=TXT:*iphone* EXTRACT=txt
SET key EVAL("var s='{{!EXTRACT}}'; var x; if(s!='#EANF#'){ x=\"YES\";}else{x=\"\";}; x")
prompt {{key}}
Available for custom iim, javascript iMacros scripts
- thecoder2012
- Posts: 446
- Joined: Sat Aug 15, 2015 5:14 pm
- Location: Internet
- Contact:
Re: EVAL If not returning value
Not with pure EVAL. Workarounds possible (textarea, javascript, second tab) or more Javascript (as *.js file). Clean up your html code.techimac wrote:can you fix this?
EVAL failed. Your problem is the content in {{!EXTRACT}} because it's HTML-Code.techimac wrote:Code: Select all
set !errorignore yes SET !TIMEOUT_PAGE 10 url goto=google.com SET !TIMEOUT_PAGE 1 wait seconds=5 TAG POS=1 TYPE=* ATTR=TXT:*iphone* EXTRACT=txt SET key EVAL("var s='{{!EXTRACT}}'; var x; if(s!='#EANF#'){ x=\"YES\";}else{x=\"\";}; x") prompt {{key}}
Errormessage: SyntaxError: unterminated string literal, line 7 (Error code: -1001) (set errorignore to NO)
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me!
Re: EVAL If not returning value
Thanks.
I need logic to find a word on web page.
I need logic to find a word on web page.
Available for custom iim, javascript iMacros scripts
- thecoder2012
- Posts: 446
- Joined: Sat Aug 15, 2015 5:14 pm
- Location: Internet
- Contact:
Re: EVAL If not returning value
See https://wiki.imacros.net/SEARCHtechimac wrote:I need logic to find a word on web page.
Small example with Textarea and Javascript as workaround:
Code: Select all
SET !TIMEOUT_PAGE 10
URL GOTO=google.com
SET !TIMEOUT_PAGE 1
WAIT SECONDS=5
TAG POS=1 TYPE=* ATTR=TXT:*iphone* EXTRACT=TXT
URL GOTO=javascript:var<SP>input<SP>=<SP>document.createElement('textarea');input.id="xyz";document.body.appendChild(input);document.focus();
TAG POS=1 TYPE=TEXTAREA ATTR=ID:xyz CONTENT={{!EXTRACT}}
SET !EXTRACT NULL
URL GOTO=javascript:document.getElementById("xyz").value=encodeURIComponent(document.getElementById("xyz").value.replace("'").replace('"'));document.focus();
TAG POS=1 TYPE=TEXTAREA ATTR=ID:xyz EXTRACT=TXT
URL GOTO=javascript:var<SP>node=document.getElementById('xyz');node.parentNode.removeChild(node);document.focus();
SET key EVAL("var s='{{!EXTRACT}}'; var x; if(s!='#EANF#'){ x=\"YES\";}else{x=\"\";}; x")
PROMPT {{key}}
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me!