Extracting data of JSON
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
Re: Extracting data of JSON
yes everything good for now
some tweaking still to do, but I'll get it.
Yes I undertand the EVAL statement and will be able to use that in the future for other situation.
thanks a lot for your help!
some tweaking still to do, but I'll get it.
Yes I undertand the EVAL statement and will be able to use that in the future for other situation.
thanks a lot for your help!
Re: Extracting data of JSON
OK, perfect, good to hear...kevnad wrote:yes everything good for now
some tweaking still to do, but I'll get it.
Yes I undertand the EVAL statement and will be able to use that in the future for other situation.
thanks a lot for your help!
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Re: Extracting data of JSON
There has been a change in the web page and now the EVAL statement does not work anymore.
And whatever I do, I always have an error.
I have uploaded extractv2.txt. This is the new extract. Still need the same extraction.
If I do the same EVAL from iMacro, I have this error :
Error -1250: JScript statement in EVAL contains the following error: Expected ';'. Line 12: SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', x,y,z; x=s.split(d1); x;")
If I only remove the section "sondages" in the JSON, it works.
This is the EVAL statement :
SET Descr_1 "yyyyyy-EOP"
SET Descr_2 "C.D. DU VIEUX-LONGUEUIL"
SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', x,y,z; x=s.split(d1); x;")
it is a subset of the longer EVAL query that have the same issue :
SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', x,y,z; x=s.split(d1)[1].split(d2); y=x[1].split('http'); z='http'+y[1].split('\"')[0]; z;")
Works whenever I remove the sondages section.
Hope you can help!
Thanks
And whatever I do, I always have an error.
I have uploaded extractv2.txt. This is the new extract. Still need the same extraction.
If I do the same EVAL from iMacro, I have this error :
Error -1250: JScript statement in EVAL contains the following error: Expected ';'. Line 12: SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', x,y,z; x=s.split(d1); x;")
If I only remove the section "sondages" in the JSON, it works.
This is the EVAL statement :
SET Descr_1 "yyyyyy-EOP"
SET Descr_2 "C.D. DU VIEUX-LONGUEUIL"
SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', x,y,z; x=s.split(d1); x;")
it is a subset of the longer EVAL query that have the same issue :
SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', x,y,z; x=s.split(d1)[1].split(d2); y=x[1].split('http'); z='http'+y[1].split('\"')[0]; z;")
Works whenever I remove the sondages section.
Hope you can help!
Thanks
Re: Extracting data of JSON
No 'extractv2.txt' Attachment uploaded to your Post... (Needs to be zipped, '.txt' Files are not accepted by the Forum Software...)kevnad wrote:There has been a change in the web page and now the EVAL statement does not work anymore.
And whatever I do, I always have an error.
I have uploaded extractv2.txt. This is the new extract. Still need the same extraction.
If I do the same EVAL from iMacro, I have this error :If I only remove the section "sondages" in the JSON, it works.Code: Select all
Error -1250: JScript statement in EVAL contains the following error: Expected ';'. Line 12: SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', x,y,z; x=s.split(d1); x;")
This is the EVAL statement :
it is a subset of the longer EVAL query that have the same issue :Code: Select all
SET Descr_1 "yyyyyy-EOP" SET Descr_2 "C.D. DU VIEUX-LONGUEUIL" SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', x,y,z; x=s.split(d1); x;")
Works whenever I remove the sondages section.Code: Select all
SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', x,y,z; x=s.split(d1)[1].split(d2); y=x[1].split('http'); z='http'+y[1].split('\"')[0]; z;")
Hope you can help!
Thanks
I guess your "sondages" Section probably contains as well some Strings that I used in the 2 'Descr_1' + 'Descr_2' Vars for the 'split()' Statements in the 'EVAL()' which probably shift the "[1]" I use in the 'EVAL()' to "[2]" or "[3]"...
Just like you need to return some "x[1]" or "x[n]" instead of only "x" in:
Code: Select all
SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', x,y,z; x=s.split(d1); x;")
I was already using the 2 ('Descr_n') Vars as a "Double Safe" Mechanism to make sure your URL would only be found after 'Descr_1', as 'Descr_2' was already/also present in some other Sections before the one you were interested in..., (and I declared them outside the 'EVAL()' for them to be easily modified if anything changed), => you might now need to adapt 'Descr_1' to some String that will occur for the 1st time, ... or to add another extra Level of 'split()' with a 3rd Var to make sure your URL you want to isolate still appears uniquely and for the 1st time in the '!EXTRACT'.
Last edited by chivracq on Mon Oct 29, 2018 6:59 pm, edited 1 time in total.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Re: Extracting data of JSON
Oh but hum, concerning the RuntimeError you are getting about a missing ';', I was using a "somewhat simplified" Syntax that allows to use the "var" Declaration only once if all Vars are separated by a Comma (','), which works on FF (where "var" is not even needed), but iMB is a little bit "stricter" with Var Declarations in 'EVAL()' and might need the "var" Keyword for all Vars..., although it looks like it was working before, so I'm not sure that will be the "real" Culprit...
Code: Select all
SET URL_nav EVAL("var s='{{!EXTRACT}}'; var d1='{{Descr_1}}'; var d2='{{Descr_2}}'; var x=s.split(d1); x[1];")
PROMPT _{{URL_nav}}_
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Re: Extracting data of JSON
Here's the extractv2 in zip.
I'll check your answer for all you wrote
but basically, the EVAL was working flawlessly but the change on the page.
I'll check your answer for all you wrote
but basically, the EVAL was working flawlessly but the change on the page.
- Attachments
-
- extractv2.zip
- (2.06 KiB) Downloaded 221 times
Re: Extracting data of JSON
The Descr_1 is only one time in the extract
So I tried with only this one with this EVAL :
SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', x,y,z; x=s.split(d1); x;")
And if I don't have the new section, it works, but if it's there, it does not.
It is something with the sondage section... and can't find it.
I remove it, and put something else in this section (a copy of another section) and make it bigger and it's working.
So I tried with only this one with this EVAL :
SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', x,y,z; x=s.split(d1); x;")
And if I don't have the new section, it works, but if it's there, it does not.
It is something with the sondage section... and can't find it.
I remove it, and put something else in this section (a copy of another section) and make it bigger and it's working.
Re: Extracting data of JSON
I found that if I remove this line from the "sondage" section :
"texte":"La Caisse C.D. DU VIEUX-LONGUEUIL aimerait avoir votre avis sur l'utilisation de vos données pour vos offres Desjardins.",
everything works good!
Even if I only remove the weird character (that is the é character), it does not work, I have to remove the line completly for it to work...
any idea why?
"texte":"La Caisse C.D. DU VIEUX-LONGUEUIL aimerait avoir votre avis sur l'utilisation de vos données pour vos offres Desjardins.",
everything works good!
Even if I only remove the weird character (that is the é character), it does not work, I have to remove the line completly for it to work...
any idea why?
Re: Extracting data of JSON
kevnad wrote:Here's the extractv2 in zip.
I'll check your answer for all you wrote
but basically, the EVAL was working flawlessly but the change on the page.
kevnad wrote:The Descr_1 is only one time in the extract
So I tried with only this one with this EVAL :
SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', x,y,z; x=s.split(d1); x;")
And if I don't have the new section, it works, but if it's there, it does not.
It is something with the sondage section... and can't find it.
I remove it, and put something else in this section (a copy of another section) and make it bigger and it's working.
OK, I was able to have a look at your "new" 'JSON' File...kevnad wrote:I found that if I remove this line from the "sondage" section :
"texte":"La Caisse C.D. DU VIEUX-LONGUEUIL aimerait avoir votre avis sur l'utilisation de vos données pour vos offres Desjardins.",
everything works good!
Even if I only remove the weird character (that is the é character), it does not work, I have to remove the line completly for it to work...
any idea why?
In my Test, there is no ""xxxxxx-EOP" in the File anymore, so the 'split()' on that 'Descr_1' String does a bit nothing and returns the complete original '!EXTRACT' in 'x[0]', but 'x[1]' doesn't exist anymore.
There are 2 Strings that are present: "yyyyyy-EOP" + "zzzzzzzz-EOP", => you need to adapt 'Descr_1' to the Value/String that you want exactly...
Or it is possible to shorten 'Descr_1' to only "-EOP" which is contained in both Strings, then 'x[1]' will return the correspond 'URL_nav' to "yyyyyy-EOP" and 'x[2]' will return the corresponding 'URL_nav' to "zzzzzzzz-EOP"...:
With 'x[1]':
Code: Select all
VERSION BUILD=8820413 RECORDER=FX
SET !EXTRACT_TEST_POPUP NO
TAB T=1
'URL GOTO=file:///D:/TEMP/iMacros/Temp/_Forum%20Cases/kevnad/extract.json
'URL GOTO=file:///D:/TEMP/iMacros/Temp/_Forum%20Cases/kevnad/extractv2.json
'SET Descr_1 "xxxxxx-EOP"
SET Descr_1 "-EOP"
SET Descr_2 "C.D. DU VIEUX-LONGUEUIL"
TAG POS=1 TYPE=PRE ATTR=TXT:{<SP>"messages":[<SP>],<SP>"detention":{<SP>"messages":[* EXTRACT=TXT
SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', x,y,z; x=s.split(d1)[1].split(d2); y=x[1].split('http'); z='http'+y[1].split('\"')[0]; z;")
PROMPT URL_nav:<BR>_{{URL_nav}}_
Code: Select all
URL_nav:
_https://xxxxxx.xxxx.com/sommaire-perso/sommaire-aiguilleur/EOP/COP_PFIC_095203bd6485af3e534a7f011c90fe4b05bc39103fc78793e8549256a7c0b351/detail_
Code: Select all
VERSION BUILD=8820413 RECORDER=FX
SET !EXTRACT_TEST_POPUP NO
TAB T=1
'URL GOTO=file:///D:/TEMP/iMacros/Temp/_Forum%20Cases/kevnad/extract.json
'URL GOTO=file:///D:/TEMP/iMacros/Temp/_Forum%20Cases/kevnad/extractv2.json
'SET Descr_1 "xxxxxx-EOP"
SET Descr_1 "-EOP"
SET Descr_2 "C.D. DU VIEUX-LONGUEUIL"
TAG POS=1 TYPE=PRE ATTR=TXT:{<SP>"messages":[<SP>],<SP>"detention":{<SP>"messages":[* EXTRACT=TXT
SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', x,y,z; x=s.split(d1)[2].split(d2); y=x[1].split('http'); z='http'+y[1].split('\"')[0]; z;")
PROMPT URL_nav:<BR>_{{URL_nav}}_
Code: Select all
URL_nav:
_https://xxxxxx.xxxx.com/sommaire-perso/sommaire-aiguilleur/EOP/COP_PFIC_e404b4cb5b77cdf6eb82bd40b02b644b5a95e8e0e4b341af08d5a985732c8fde/detail_
(Tested on iMacros for FF v8.8.2, Pale Moon v26.3.3 (=FF47), Win10_x64.)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Re: Extracting data of JSON
My mistake about the Descr1 and 2 not fitting, I had change some stuff in the json that were more confidential.
So, with the JSON file I have uploaded, here's the line that is needed :
SET Descr_1 "yyyyyy-EOP"
SET Descr_2 "C.D. DU VIEUX-LONGUEUIL"
SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', x,y,z; x=s.split(d1)[1].split(d2); y=x[1].split('http'); z='http'+y[1].split('\"')[0]; z;")
with iMacro Browser, I always get this error :
Error -1250: JScript statement in EVAL contains the following error: Expected ';'. Line 11: SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', x,y,z; x=s.split(d1)[1].split(d2); y=x[1].split('http'); z='http'+y[1].split('\"')[0]; z;")
If I remove this line in the JSON (line 377) :
"texte":"La Caisse C.D. DU VIEUX-LONGUEUIL aimerait avoir votre avis sur l'utilisation de vos données pour vos offres Desjardins.",
then it works fine.
Are you saying that on your side (which I think you are using FF) it is working?
thanks for your help!
So, with the JSON file I have uploaded, here's the line that is needed :
SET Descr_1 "yyyyyy-EOP"
SET Descr_2 "C.D. DU VIEUX-LONGUEUIL"
SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', x,y,z; x=s.split(d1)[1].split(d2); y=x[1].split('http'); z='http'+y[1].split('\"')[0]; z;")
with iMacro Browser, I always get this error :
Error -1250: JScript statement in EVAL contains the following error: Expected ';'. Line 11: SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', x,y,z; x=s.split(d1)[1].split(d2); y=x[1].split('http'); z='http'+y[1].split('\"')[0]; z;")
If I remove this line in the JSON (line 377) :
"texte":"La Caisse C.D. DU VIEUX-LONGUEUIL aimerait avoir votre avis sur l'utilisation de vos données pour vos offres Desjardins.",
then it works fine.
Are you saying that on your side (which I think you are using FF) it is working?
thanks for your help!
Re: Extracting data of JSON
I found that the problem in the line is with the ' character :
"texte":"La Caisse C.D. DU VIEUX-LONGUEUIL aimerait avoir votre avis sur l'utilisation de vos données pour vos offres Desjardins.",
l'utilisation
I guess this make the rest of the line to be a comment, so that might be the reason why it complained about a missing ;
"texte":"La Caisse C.D. DU VIEUX-LONGUEUIL aimerait avoir votre avis sur l'utilisation de vos données pour vos offres Desjardins.",
l'utilisation
I guess this make the rest of the line to be a comment, so that might be the reason why it complained about a missing ;
Re: Extracting data of JSON
kevnad wrote:My mistake about the Descr1 and 2 not fitting, I had change some stuff in the json that were more confidential.
So, with the JSON file I have uploaded, here's the line that is needed :with iMacro Browser, I always get this error :Code: Select all
SET Descr_1 "yyyyyy-EOP" SET Descr_2 "C.D. DU VIEUX-LONGUEUIL" SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', x,y,z; x=s.split(d1)[1].split(d2); y=x[1].split('http'); z='http'+y[1].split('\"')[0]; z;")
If I remove this line in the JSON (line 377) :Code: Select all
Error -1250: JScript statement in EVAL contains the following error: Expected ';'. Line 11: SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', x,y,z; x=s.split(d1)[1].split(d2); y=x[1].split('http'); z='http'+y[1].split('\"')[0]; z;")
"texte":"La Caisse C.D. DU VIEUX-LONGUEUIL aimerait avoir votre avis sur l'utilisation de vos données pour vos offres Desjardins.",
then it works fine.
Are you saying that on your side (which I think you are using FF) it is working?
thanks for your help!
Yep, no Pb for me using v8.8.2 for FF...kevnad wrote:I found that the problem in the line is with the ' character :
"texte":"La Caisse C.D. DU VIEUX-LONGUEUIL aimerait avoir votre avis sur l'utilisation de vos données pour vos offres Desjardins.",
l'utilisation
I guess this make the rest of the line to be a comment, so that might be the reason why it complained about a missing ;
So OK, if the _'_ Char is causing the Pb, which I still find a bit "strange" as this "l'utilisation" is after the (last) "C.D. DU VIEUX-LONGUEUIL" in the "sondage" Section and the 'EVAL()' Statement doesn't do anything with that final truncated part of the '!EXTRACT', and in my "Experience" (though always on FF indeed), 'EVAL()' has always been able to handle "by itself" Single and Double Quotes if they already come from the '!EXTRACT', although as your Case was a bit "complex" already, and I always try to use no more than 3 "x,y,z" Vars for building the Return for the 'EVAL()', I had to combine several Commands within each Step, which I rarely do for myself, so it might be safer then to use the "decomposed" Equivalent I had posted that used a separate Temp Var for each Step, with "a,b,c,d,e,z", without combining several Commands per Step...:
=> You can try this one if it works "better", + could add a 'SET !ERRORIGNORE YES' as well, is "good Practice" anyway, Script will always abort otherwise if any 'Array[1]' does not exist when doing a Double 'split()' in a same 'EVAL()'...chivracq wrote:I can "decompose" the 'EVAL()' Statement into more Sub-Statements, then it's maybe easier to follow...:
=> ... becomes:Code: Select all
SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', x,y,z; x=s.split(d1)[1].split(d2); y=x[1].split('http'); z='http'+y[1].split('\"')[0]; z;")
=> And you simply "follow" a=>b=>c=>d=>e and =>z that I always use for the "final" Result..., where I each time reuse the previous Expression...Code: Select all
SET URL_nav EVAL("var s='{{!EXTRACT}}', d1='{{Descr_1}}', d2='{{Descr_2}}', a,b,c,d,e,z; a=s.split(d1); b=a[1].split(d2); c=b[1].split('http'); d=c[1].split('\"'); e=d[0]; z='http'+e; z;")
And if "stg" goes wrong, you can easily debug the whole 'EVAL()' by simply changing the last 'z' to any intermediary Var to check them one by one that they already return what you expect...
And to be even "safer", it would be possible to implement some kind of 'END_OF_PAGE' Functionality (a bit like the '!END_OF_PAGE' for iMB/IE) to tell the 'EVAL()' to first truncate the '!EXTRACT' and to ignore the "sondage" Section (which is "luckily" added at the end of the JSON File...):
>>>
[TEMP-Posting, I'm not finished, but I prefer to post this part already, in case I crash my Browser with my Tests, ah-ah...!, happens sometimes, then I would lose my Post... ]
Mini-EDIT: Don't worry, I will further post (some Script) in some other/later Post... You can post in the meantime if you want, for example if the "a,b,c,d,e,z" Syntax works better or if '!ERRORIGNORE' makes a Difference already...
Last edited by chivracq on Tue Oct 30, 2018 7:28 pm, edited 1 time in total.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Re: Extracting data of JSON
I know you have not yet finish your post, but wanted to add this information.
Even I do "nothing" in the EVAL statement, there still a problem.
Like this exemple :
TAG POS=1 TYPE=BODY ATTR=* EXTRACT=TXT
SET URL_nav EVAL("var s='{{!EXTRACT}}';s;")
PROMPT URL_nav:<BR>{{URL_nav}}
I still have the same error, and if I put the ERRORIGNORE, the variable is empty.
I had found the ENDOFPAGE command, but was not able to use for now.
thanks
Even I do "nothing" in the EVAL statement, there still a problem.
Like this exemple :
TAG POS=1 TYPE=BODY ATTR=* EXTRACT=TXT
SET URL_nav EVAL("var s='{{!EXTRACT}}';s;")
PROMPT URL_nav:<BR>{{URL_nav}}
I still have the same error, and if I put the ERRORIGNORE, the variable is empty.
I had found the ENDOFPAGE command, but was not able to use for now.
thanks
Re: Extracting data of JSON
Yeah, won't be able to use '!ENDOFPAGE' in your Case as you need to first tag some (other) HTML Element on the Page, but in your Case, the whole Content of the whole "Page" is just one single Element...kevnad wrote:I know you have not yet finish your post, but wanted to add this information.
Even I do "nothing" in the EVAL statement, there still a problem.
Like this exemple :I still have the same error, and if I put the ERRORIGNORE, the variable is empty.Code: Select all
TAG POS=1 TYPE=BODY ATTR=* EXTRACT=TXT SET URL_nav EVAL("var s='{{!EXTRACT}}';s;") PROMPT URL_nav:<BR>{{URL_nav}}
I had found the ENDOFPAGE command, but was not able to use for now.
thanks
But hum, before I go further, yep, have to handle this part first if the 'PROMPT' doesn't return anything, even on the simple/raw '!EXTRACT' through 'EVAL()', grrr...!! Seems like we are hitting a "Bug" or a "Limitation" on iMB then...
Could be related to some Size Limit in 'EXTRACT' or in 'EVAL()', although I've already extracted much bigger Pages (on 'HTML' or 'BODY' (with 'EXTRACT=TXT' or 'EXTRACT=HTM')), and on FF there is a Size Limit for the 'EXTRACT_TEST_POPUP' and 'PROMPT' but not in 'EVAL()'... And both Commands simply truncated the Data at some point, but they still displayed some large amount already...
Pfff..., OK, trying to find a Workaround...
1- Do you still get the (full) Extract in the 'EXTRACT_TEST_POPUP'...?
2- Does "PROMPT _{{!EXTRACT}}_" work...?
3- Same Qt's with 'EXTRACT=HTM' instead of 'EXTRACT=TXT'...?
4- Does your 'PROMPT' on 'EVAL()' work using 'EXTRACT=HTM'...?:
Code: Select all
TAG POS=1 TYPE=BODY ATTR=* EXTRACT=HTM
SET URL_nav EVAL("var s='{{!EXTRACT}}'; s;")
PROMPT URL_nav:<BR>_{{URL_nav}}_
Example with 'EXTRACT=TXT':
Code: Select all
TAG POS=1 TYPE=BODY ATTR=* EXTRACT=TXT
SET URL_nav EVAL("var s='{{!EXTRACT}}'; s;")
PROMPT URL_nav:<BR>_{{URL_nav}}_
SET !EXTRACT {{URL_nav}}
SAVEAS TYPE=EXTRACT FOLDER=* FILE=JSON_Test_{{!NOW:yyyy-mm-dd_hhhnn}}.txt
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Re: Extracting data of JSON
chivracq wrote:
1- Do you still get the (full) Extract in the 'EXTRACT_TEST_POPUP'...?
2- Does "PROMPT _{{!EXTRACT}}_" work...?
3- Same Qt's with 'EXTRACT=HTM' instead of 'EXTRACT=TXT'...?
4- Does your 'PROMPT' on 'EVAL()' work using 'EXTRACT=HTM'...?:5- & 6- Can you try a 'SAVEAS' both with 'EXTRACT=TXT' and '=HTM'...? (In order to bypass the 'PROMPT'...)Code: Select all
TAG POS=1 TYPE=BODY ATTR=* EXTRACT=HTM SET URL_nav EVAL("var s='{{!EXTRACT}}'; s;") PROMPT URL_nav:<BR>_{{URL_nav}}_
Example with 'EXTRACT=TXT':Code: Select all
TAG POS=1 TYPE=BODY ATTR=* EXTRACT=TXT SET URL_nav EVAL("var s='{{!EXTRACT}}'; s;") PROMPT URL_nav:<BR>_{{URL_nav}}_ SET !EXTRACT {{URL_nav}} SAVEAS TYPE=EXTRACT FOLDER=* FILE=JSON_Test_{{!NOW:yyyy-mm-dd_hhhnn}}.txt
1- Yes, I have the full extract with the EXTRACT_TEST_POPUP
2- Yes, the prompt extract works fine
3- Same problem with EXTRACT HTM than TXT
4- No, the EVAL does not work with EXTRACT HTM
5-6 The SAVEAS works fine.
Really, the issue is with the EVAL command.
I'm trying to use the Search command with a REGEXP and EXTRACT option. Still trying to figure out the REGEX to get everything until the sondage section. I think it might work with that since the ' character will not be present.
I'll let you know how it goes!
THanks