TAG POS=R1 gives the wrong result. Why?

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
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
Post Reply
User avatar
vardipoor.m
Posts: 34
Joined: Sun Jan 17, 2021 8:58 am

TAG POS=R1 gives the wrong result. Why?

Post by vardipoor.m » Mon Feb 15, 2021 2:34 pm

I USE IMACROS V12.5.503 BROWSER AND WIN 10 PRO X64
hi
this code:

Code: Select all

'next line worked
TAG POS=1 TYPE=H4 ATTR=TXT:"DOGE"&&CLASS:m-2 EXTRACT=TXT
'next line not working
TAG POS=R1 TYPE=H4 ATTR=TXT:"0.000000000000000"&&CLASS:cloud-percent CONTENT=EVENT:FAIL_IF_FOUND
I tried to write a code that if see this number"0.000000000000000"(in doge box), the macro give me -1310 error but According to the photo, at present the number inside the Dodge Box is not equal to the searched number(TXT:"0.000000000000000").
but macro gives me an error code -1310. i use EXTRACT:TXT instead of CONTENT=EVENT:FAIL_IF_FOUND to find that element and I found that it returns the number 0.000000000000000, which is inside the next box. Why?
If I remove TXT:"0.000000000000000" from the second line of code, the second line of code points to the number inside the Dodge box, and if I return it, it points to the number inside the next box!!!!!!
thanks
Attachments
Screenshot 2021-02-15 173655.jpg
Thanks to the clever and clean administrator of this forum
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: TAG POS=R1 gives the wrong result. Why?

Post by chivracq » Mon Feb 15, 2021 2:58 pm

vardipoor.m wrote:
Mon Feb 15, 2021 2:34 pm
I USE IMACROS V12.5.503 BROWSER AND WIN 10 PRO X64
hi
this code:

Code: Select all

'next line worked
TAG POS=1 TYPE=H4 ATTR=TXT:"DOGE"&&CLASS:m-2 EXTRACT=TXT
'next line not working
TAG POS=R1 TYPE=H4 ATTR=TXT:"0.000000000000000"&&CLASS:cloud-percent CONTENT=EVENT:FAIL_IF_FOUND
I tried to write a code that if see this number"0.000000000000000"(in doge box), the macro give me -1310 error but According to the photo, at present the number inside the Dodge Box is not equal to the searched number(TXT:"0.000000000000000").
but macro gives me an error code -1310. i use EXTRACT:TXT instead of CONTENT=EVENT:FAIL_IF_FOUND to find that element and I found that it returns the number 0.000000000000000, which is inside the next box. Why?
If I remove TXT:"0.000000000000000" from the second line of code, the second line of code points to the number inside the Dodge box, and if I return it, it points to the number inside the next box!!!!!!
thanks

Yep, Behaviour is "Normal", 'POS=R1' with "TXT:0.000000000000000" will find the "next" one, ... which then belongs to the "LTC" Box...

For the Behaviour that you want, you need to use 'EXTRACT' + 'EVAL()' + 'MacroError()'... :idea:
- (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...
User avatar
vardipoor.m
Posts: 34
Joined: Sun Jan 17, 2021 8:58 am

Re: TAG POS=R1 gives the wrong result. Why?

Post by vardipoor.m » Mon Feb 15, 2021 3:09 pm

can you help me for EVAL()?

No need anymore
I found a combination solution that works like shallot yogurt.
The combination of
vbs and imacros and iimget ;)

Code: Select all

	macro = "TAG POS=1 TYPE=H4 ATTR=TXT:"DOGE"&&CLASS:m-2 
	macro = macro + "TAG POS=R1 TYPE=H4 ATTR=CLASS:cloud-percent EXTRACT:TXT"
	iret = iim.iimPlayCode(macro)
        vbsvar1 = 0.000000000000000
        vbsvar2 = iim.iimGetExtract(1)
        
	'if extracted text and your var is same then do somthing
        iF  vbsvar1 = vbsvar2 THEN
	     do somthing
        END IF
In addition, according to iMacros, the value of variables is reset after each run of iimplay. I found a combined solution, although it may have already been discovered. I say only to inform others.
You can enter iMacros variables into a variable in vbs with the iimget command and enter them into an iMacros variable with the iimset command. Then use this variable in other macros. ،this worked for me
Thanks to the clever and clean administrator of this forum
Post Reply