Page 1 of 1

Relative Positioning Only Works Sometimes

Posted: Thu Jul 19, 2018 5:49 am
by senor pengwin
Hello There,

Need a little bit of help please!!

VERSION BUILD=12.0.501.6698
IMacros Browser
Windows 7 64 Bit

I am trying to run this code by using a variable but the problem is that the POS value keeps changing for the TXT I use. This is a calendar table and I am trying to select a day, and most of them are in the same position but a few numbers are in a different POS and they change. I tried to select the header of the table and use the relative positioning which works but the problem is once it gets to POS 3 or 4 it no longer selects the correct day. Is there something I am doing wrong? How else can I find a way to select the correct day regardless of the POS?

Here is my code, the website is behind a login and pw.

Code: Select all

VERSION BUILD=12.0.501.6698
TAB T=1
URL GOTO=https://URL
TAG POS=1 TYPE=LI ATTR=ID:lpnCal
TAG POS=1 TYPE=DIV ATTR=ID:nCalFrom
TAG POS=1 TYPE=TD ATTR=ID:calBackF
TAG POS=1 TYPE=TD ATTR=ID:calBackF
TAG POS=1 TYPE=TD ATTR=ID:calTitleF  'Selects title of table to select start date
TAG POS=R1 TYPE=TD ATTR=TXT:{{StartDate}}
TAG POS=1 TYPE=TD ATTR=ID:calBack
TAG POS=1 TYPE=TD ATTR=ID:calBack
TAG POS=1 TYPE=TD ATTR=ID:calTitle  'Selects title of table to select end date
TAG POS=R1 TYPE=TD ATTR=TXT:{{EndDate}}

Thank you!

Re: Relative Positioning Only Works Sometimes

Posted: Thu Jul 19, 2018 11:52 am
by chivracq
senor pengwin wrote:Hello There,

Need a little bit of help please!!

Code: Select all

VERSION BUILD=12.0.501.6698
IMacros Browser
Windows 7 64 Bit
I am trying to run this code by using a variable but the problem is that the POS value keeps changing for the TXT I use. This is a calendar table and I am trying to select a day, and most of them are in the same position but a few numbers are in a different POS and they change. I tried to select the header of the table and use the relative positioning which works but the problem is once it gets to POS 3 or 4 it no longer selects the correct day. Is there something I am doing wrong? How else can I find a way to select the correct day regardless of the POS?

Here is my code, the website is behind a login and pw.

Code: Select all

VERSION BUILD=12.0.501.6698
TAB T=1
URL GOTO=https://URL
TAG POS=1 TYPE=LI ATTR=ID:lpnCal
TAG POS=1 TYPE=DIV ATTR=ID:nCalFrom
TAG POS=1 TYPE=TD ATTR=ID:calBackF
TAG POS=1 TYPE=TD ATTR=ID:calBackF
TAG POS=1 TYPE=TD ATTR=ID:calTitleF  'Selects title of table to select start date
TAG POS=R1 TYPE=TD ATTR=TXT:{{StartDate}}
TAG POS=1 TYPE=TD ATTR=ID:calBack
TAG POS=1 TYPE=TD ATTR=ID:calBack
TAG POS=1 TYPE=TD ATTR=ID:calTitle  'Selects title of table to select end date
TAG POS=R1 TYPE=TD ATTR=TXT:{{EndDate}}
Thank you!
Hum, Content of this Thread is about pure ('.iim') iMacros, not related to the 'Scripting Interface', Thread will probably get moved to the 'General' Sub-Forum...

Hum, I guess your 'StartDate' and 'EndDate' Vars only contain a Day of the Month, which should be unique on this Calendar for each Month, then I don't really understand the "POS=3" or "=4"... :?

But "usually", the Purpose of having some Calendar Widget on a Web-Page if for the User to select a Date..., that will be reused by the Web-Page in some (often hidden) 'INPUT' Field that your Script could attempt to fill in directly, without the Use of the Calendar... :idea:

Consider giving a "Try" at the 'EVENT' Mode, though I don't think that will help..., as all 'TD' Cells for all Days probably have the same 'ID' (or no 'ID') and the 'EVENT' Mode will rely on the 'POS_Nb' as well and using 'R-Positioning' in the 'EVENT' is a bit trickier than in the 'TAG' Mode, so you'll probably be hitting the same Limitation...

Hum, Page is behind L&P..., maybe you can upload some HTML Saveas of the Page (zipped) to your Thread, then I could have a look, if you don't come out by yourself... (+ Mention some concrete Example(s) for both 'xxxDate' Vars...)

Re: Reative Positioning Only Works Sometimes

Posted: Thu Jul 19, 2018 3:19 pm
by senor pengwin
chivracq wrote:Hum, Content of this Thread is about pure ('.iim') iMacros, not related to the 'Scripting Interface', Thread will probably get moved to the 'General' Sub-Forum...

Hum, I guess your 'StartDate' and 'EndDate' Vars only contain a Day of the Month, which should be unique on this Calendar for each Month, then I don't really understand the "POS=3" or "=4"... :?

But "usually", the Purpose of having some Calendar Widget on a Web-Page if for the User to select a Date..., that will be reused by the Web-Page in some (often hidden) 'INPUT' Field that your Script could attempt to fill in directly, without the Use of the Calendar... :idea:

Consider giving a "Try" at the 'EVENT' Mode, though I don't think that will help..., as all 'TD' Cells for all Days probably have the same 'ID' (or no 'ID') and the 'EVENT' Mode will rely on the 'POS_Nb' as well and using 'R-Positioning' in the 'EVENT' is a bit trickier than in the 'TAG' Mode, so you'll probably be hitting the same Limitation...

Hum, Page is behind L&P..., maybe you can upload some HTML Saveas of the Page (zipped) to your Thread, then I could have a look, if you don't come out by yourself... (+ Mention some concrete Example(s) for both 'xxxDate' Vars...)
Whoops! You are correct I probably should have put this in General.

But since we are here, you are correct, the day is being selected from a calendar widget, it seems simple enough but the issue is that days in the same month have different POS.

Let me give you an example, lets say I select days 1-8 without relative positioning, it would look something like this:

Code: Select all

TAG POS=1 TYPE=TD ATTR=TXT:1
TAG POS=1 TYPE=TD ATTR=TXT:2
TAG POS=1 TYPE=TD ATTR=TXT:3
TAG POS=2 TYPE=TD ATTR=TXT:4
TAG POS=2 TYPE=TD ATTR=TXT:5
TAG POS=2 TYPE=TD ATTR=TXT:6
TAG POS=4 TYPE=TD ATTR=TXT:7
TAG POS=4 TYPE=TD ATTR=TXT:8
When I select the widget title before and use R1 relative positioning I can select the numbers from POS 1-2 but once it gets to POS 3 or 4 it wont select the numbers. And, it is completely possible that the POS for each number changes each day.

I have included a zip file of the HTML page. It looks like this line is where the calendar info starts but I am not well versed in HTML:

Code: Select all

        <div id="leftPaneBodyCal" class="body row paneleft paneShadeRt"><section id="calWrapper" class="body row scroll-y"><div id="nCalFrom" class="navb mBtnAct bgInTxt" data-bgtxt="From:">...</div>

Thanks!!

Re: Relative Positioning Only Works Sometimes

Posted: Thu Jul 19, 2018 8:16 pm
by chivracq
senor pengwin wrote:Whoops! You are correct I probably should have put this in General.

But since we are here, you are correct, the day is being selected from a calendar widget, it seems simple enough but the issue is that days in the same month have different POS.

Let me give you an example, lets say I select days 1-8 without relative positioning, it would look something like this:

Code: Select all

TAG POS=1 TYPE=TD ATTR=TXT:1
TAG POS=1 TYPE=TD ATTR=TXT:2
TAG POS=1 TYPE=TD ATTR=TXT:3
TAG POS=2 TYPE=TD ATTR=TXT:4
TAG POS=2 TYPE=TD ATTR=TXT:5
TAG POS=2 TYPE=TD ATTR=TXT:6
TAG POS=4 TYPE=TD ATTR=TXT:7
TAG POS=4 TYPE=TD ATTR=TXT:8
When I select the widget title before and use R1 relative positioning I can select the numbers from POS 1-2 but once it gets to POS 3 or 4 it wont select the numbers. And, it is completely possible that the POS for each number changes each day.

I have included a zip file of the HTML page. It looks like this line is where the calendar info starts but I am not well versed in HTML:

Code: Select all

        <div id="leftPaneBodyCal" class="body row paneleft paneShadeRt"><section id="calWrapper" class="body row scroll-y"><div id="nCalFrom" class="navb mBtnAct bgInTxt" data-bgtxt="From:">...</div>
Thanks!!
Yeah, don't worry about the Sub-Forum, I will ask the Forum Admin to move your Thread to the 'General' Sub-Forum... (I cannot do it myself...)

But..., OK...!, Okay-Okay...! Lots of "things" to say, I need to "organize" my Thoughts, ah-ah...! :P
(I have a pretty "messy" Mind, I'm afraid..., the "Ransom" of "Creativity", I guess/hope...! :shock: )

Good for the HTML Saveas, except that many external Scripts are missing, + CSS is lost as well, so I don't really get your Calendar(s) to see and play with for the 2 Dates, the 2 'calF'/'calBodyF' + 'cal'/'calBody' Elements (Tables) do not get populated for me, I only see the empty Containers (and in the Source as well)...

I don't see either any ''INPUT' Field like I had mentioned, except some "strange":

Code: Select all

TAG POS=1 TYPE=TEXTAREA ATTR=ID:calFData CONTENT=<Cal><M<SP>b="11304"<SP>e="11331"<SP>p="P1"></M><M<SP>b="11332"<SP>e="11359"<SP>p="P2"></M><M<SP>b="11360"<SP>e="11394"<SP>p="P3"></M><M<SP>b="11395"<SP>e="11422"<SP>p="P4"></M><M<SP>b="11423"<SP>e="11450"<SP>p="P5"></M><M<SP>b="11451"<SP>e="11485"<SP>p="P6"></M><M<SP>b="11486"<SP>e="11513"<SP>p="P7"></M><M<SP>b="11514"<SP>e="11541"<SP>p="P8"></M><M<SP>b="11542"<SP>e="11576"<SP>p="P9"></M><M<SP>b="11577"<SP>e="11604"<SP>p="P10"></M><M<SP>b="11605"<SP>e="11632"<SP>p="P11"></M><M<SP>b="11633"<SP>e="11667"<SP>p="P12"></M>
<M<SP>b="11668"<SP>e="11695"<SP>p="P1"></M><M<SP>b="11696"<SP>e="11723"<SP>p="P2"></M><M<SP>b="11724"<SP>e="11758"<SP>p="P3"></M><M<SP>b="11759"<SP>e="11786"<SP>p="P4"></M><M<SP>b="11787"<SP>e="11814"<SP>p="P5"></M><M<SP>b="11815"<SP>e="11849"<SP>p="P6"></M><M<SP>b="11850"<SP>e="11877"<SP>p="P7"></M><M<SP>b="11878"<SP>e="11905"<SP>p="P8"></M><M<SP>b="11906"<SP>e="11940"<SP>p="P9"></M><M<SP>b="11941"<SP>e="11968"<SP>p="P10"></M><M<SP>b="11969"<SP>e="11996"<SP>p="P11"></M><M<SP>b="11997"<SP>e="12031"<SP>p="P12"></M>
<M<SP>b="12032"<SP>e="12059"<SP>p="P1"></M><M<SP>b="12060"<SP>e="12087"<SP>p="P2"></M><M<SP>b="12088"<SP>e="12122"<SP>p="P3"></M><M<SP>b="12123"<SP>e="12150"<SP>p="P4"></M><M<SP>b="12151"<SP>e="12178"<SP>p="P5"></M><M<SP>b="12179"<SP>e="12213"<SP>p="P6"></M><M<SP>b="12214"<SP>e="12241"<SP>p="P7"></M><M<SP>b="12242"<SP>e="12269"<SP>p="P8"></M><M<SP>b="12270"<SP>e="12304"<SP>p="P9"></M><M<SP>b="12305"<SP>e="12332"<SP>p="P10"></M><M<SP>b="12333"<SP>e="12360"<SP>p="P11"></M><M<SP>b="12361"<SP>e="12395"<SP>p="P12"></M>
<M<SP>b="12396"<SP>e="12423"<SP>p="P1"></M><M<SP>b="12424"<SP>e="12451"<SP>p="P2"></M><M<SP>b="12452"<SP>e="12486"<SP>p="P3"></M><M<SP>b="12487"<SP>e="12514"<SP>p="P4"></M><M<SP>b="12515"<SP>e="12542"<SP>p="P5"></M><M<SP>b="12543"<SP>e="12577"<SP>p="P6"></M><M<SP>b="12578"<SP>e="12605"<SP>p="P7"></M><M<SP>b="12606"<SP>e="12611"<SP>p="P8"></M></Cal>
... editable 'TEXTAREA' (only for the 'From' Date) that is probably used to populate the 'From' Calendar, no idea why it is editable...!?

The Data is very strange, I didn't really/completely understand the "System", it looks like it's taking all the Dates since Jan-2015 until Aug-2018 using some "weird" System with Years of 364(!?) Days divided into 12 "Months" of either 27 OR 34 Days, based on some strange "Post-Gregorian" Calendar, 402 Years later(...!?), or kind of 'POSIX' "Date" (not Time!) based, starting on 1984-01-01... What the F*ck...!?!? :shock:

Funny bit is that I managed to crash the Win10 'calc.exe', while doing some "Calculations" with that Data, trying to "reverse" the underlying "System", ah-ah...!! Even the Windows Calculator didn't like it, ah-ah...!, first time ever I see 'calc.exe' crashing, since Win 3.10, ah-ah...!! 8)

But OK, as I cannot "see" the Calendar(s), I cannot really try all the "Things" and "Tricks" I would normally try..., Grrr...!! :twisted:

But I can think of several (possible) Solutions...:
- If you could find out where the '4' + '5' + '6' are located for 'POS=1', and if '1' always has 'POS=1', maybe you could use R-Positioning x2, first on the '1' and then a 2nd time on your chosen Day, with the 2nd being "Conditional" for when you really want to select '1'. And maybe 'R-Pos' x1 is enough, with Day '1' as the Anchor.

- When the Calendar is opened, I guess either the first Day of the Month => '1', or the Current Day/Date gets automatically the Focus (and you can always force the Focus on the Current Day with the 'calTitle[F]' or 'calCurrent' Button, I guess...), you could then choose your Day relatively using the '-1' or '+1' Buttons, but hum, you might need to hard-code up to 30 times the same 'TAG' Statement, with 30x an 'EVAL()' Statement to decide if your Script is "really" going to click on that '-1'/'+1' Button for each 'TAG' Statement...
Not really-really Best Practice, I would think..., but you could control that Looping from your Main '.vba' Script in your Case..., now that you've "found out" how to use 'For' Loops in '.vba' with iMacros, ah-ah...! :wink:

Easier with the same Idea might be to use the 'EVENT' Mode with the Keyboard Arrows (or the 'TAB' Key), where the Nb of 'Arrow+Left/Right' could be computed with only one 'EVAL()' Statement...
But, hum, I'm not completely sure if the 'EVENT' Mode for iMB v12.0 supports the 'KEY' Parameter for the 'KEYPRESS' Command, ah-ah...!

Re: Reative Positioning Only Works Sometimes

Posted: Thu Jul 19, 2018 9:09 pm
by senor pengwin
chivracq wrote:Yeah, don't worry about the Sub-Forum, I will ask the Forum Admin to move your Thread to the 'General' Sub-Forum... (I cannot do it myself...)

But..., OK...!, Okay-Okay...! Lots of "things" to say, I need to "organize" my Thoughts, ah-ah...! :P
(I have a pretty "messy" Mind, I'm afraid..., the "Ransom" of "Creativity", I guess/hope...! :shock: )

Good for the HTML Saveas, except that many external Scripts are missing, + CSS is lost as well, so I don't really get your Calendar(s) to see and play with for the 2 Dates, the 2 'calF'/'calBodyF' + 'cal'/'calBody' Elements (Tables) do not get populated for me, I only see the empty Containers (and in the Source as well)...

I don't see either any ''INPUT' Field like I had mentioned, except some "strange":

Code: Select all

TAG POS=1 TYPE=TEXTAREA ATTR=ID:calFData CONTENT=<Cal><M<SP>b="11304"<SP>e="11331"<SP>p="P1"></M><M<SP>b="11332"<SP>e="11359"<SP>p="P2"></M><M<SP>b="11360"<SP>e="11394"<SP>p="P3"></M><M<SP>b="11395"<SP>e="11422"<SP>p="P4"></M><M<SP>b="11423"<SP>e="11450"<SP>p="P5"></M><M<SP>b="11451"<SP>e="11485"<SP>p="P6"></M><M<SP>b="11486"<SP>e="11513"<SP>p="P7"></M><M<SP>b="11514"<SP>e="11541"<SP>p="P8"></M><M<SP>b="11542"<SP>e="11576"<SP>p="P9"></M><M<SP>b="11577"<SP>e="11604"<SP>p="P10"></M><M<SP>b="11605"<SP>e="11632"<SP>p="P11"></M><M<SP>b="11633"<SP>e="11667"<SP>p="P12"></M>
<M<SP>b="11668"<SP>e="11695"<SP>p="P1"></M><M<SP>b="11696"<SP>e="11723"<SP>p="P2"></M><M<SP>b="11724"<SP>e="11758"<SP>p="P3"></M><M<SP>b="11759"<SP>e="11786"<SP>p="P4"></M><M<SP>b="11787"<SP>e="11814"<SP>p="P5"></M><M<SP>b="11815"<SP>e="11849"<SP>p="P6"></M><M<SP>b="11850"<SP>e="11877"<SP>p="P7"></M><M<SP>b="11878"<SP>e="11905"<SP>p="P8"></M><M<SP>b="11906"<SP>e="11940"<SP>p="P9"></M><M<SP>b="11941"<SP>e="11968"<SP>p="P10"></M><M<SP>b="11969"<SP>e="11996"<SP>p="P11"></M><M<SP>b="11997"<SP>e="12031"<SP>p="P12"></M>
<M<SP>b="12032"<SP>e="12059"<SP>p="P1"></M><M<SP>b="12060"<SP>e="12087"<SP>p="P2"></M><M<SP>b="12088"<SP>e="12122"<SP>p="P3"></M><M<SP>b="12123"<SP>e="12150"<SP>p="P4"></M><M<SP>b="12151"<SP>e="12178"<SP>p="P5"></M><M<SP>b="12179"<SP>e="12213"<SP>p="P6"></M><M<SP>b="12214"<SP>e="12241"<SP>p="P7"></M><M<SP>b="12242"<SP>e="12269"<SP>p="P8"></M><M<SP>b="12270"<SP>e="12304"<SP>p="P9"></M><M<SP>b="12305"<SP>e="12332"<SP>p="P10"></M><M<SP>b="12333"<SP>e="12360"<SP>p="P11"></M><M<SP>b="12361"<SP>e="12395"<SP>p="P12"></M>
<M<SP>b="12396"<SP>e="12423"<SP>p="P1"></M><M<SP>b="12424"<SP>e="12451"<SP>p="P2"></M><M<SP>b="12452"<SP>e="12486"<SP>p="P3"></M><M<SP>b="12487"<SP>e="12514"<SP>p="P4"></M><M<SP>b="12515"<SP>e="12542"<SP>p="P5"></M><M<SP>b="12543"<SP>e="12577"<SP>p="P6"></M><M<SP>b="12578"<SP>e="12605"<SP>p="P7"></M><M<SP>b="12606"<SP>e="12611"<SP>p="P8"></M></Cal>
... editable 'TEXTAREA' (only for the 'From' Date) that is probably used to populate the 'From' Calendar, no idea why it is editable...!?

The Data is very strange, I didn't really/completely understand the "System", it looks like it's taking all the Dates since Jan-2015 until Aug-2018 using some "weird" System with Years of 364(!?) Days divided into 12 "Months" of either 27 OR 34 Days, based on some strange "Post-Gregorian" Calendar, 402 later(...!?), or kind of 'POSIX' "Date" (not Time!) based, starting on 1984-01-01... What the F*ck...!?!? :shock:

Funny bit is that I managed to crash the Win10 'calc.exe', while doing some "Calculations" with that Data, trying to "reverse" the underlying "System", ah-ah...!! Even the Windows Calculator didn't like it, ah-ah...!, first time ever I see 'calc.exe' crashing, since Win 3.10, ah-ah...!! 8)

But OK, as I cannot "see" the Calendar(s), I cannot really try all the "Things" and "Tricks" I would normally try..., Grrr...!! :twisted:

But I can think of several (possible) Solutions...:
- If you could find out where the '4' + '5' + '6' are located for 'POS=1', and if '1' always has 'POS=1', maybe you could use R-Positioning x2, first on the '1' and then a 2nd time on your chosen Day, with the 2nd being "Conditional" for when you really want to select '1'. And maybe 'R-Pos' x1 is enough, with Day '1' as the Anchor.

- When the Calendar is opened, I guess either the first Day of the Month => '1', or the Current Day/Date gets automatically the Focus (and you can always force the Focus on the Current Day with the 'calTitle[F]' or 'calCurrent' Button, I guess...), you could then choose your Day relatively using the '-1' or '+1' Buttons, but hum, you might need to hard-code up to 30 times the same 'TAG' Statement, with 30x an 'EVAL()' Statement to decide if your Script is "really" going to click on that '-1'/'+1' Button for each 'TAG' Statement...
Not really-really Best Practice, I would think..., but you could control that Looping from your Main '.vba' Script in your Case..., now that you've "found out" how to use 'For' Loops in '.vba' with iMacros, ah-ah...! :wink:

Easier with the same Idea might be to use the 'EVENT' Mode with the Keyboard Arrows (or the 'TAB' Key), where the Nb of 'Arrow+Left/Right' could be computed with only one 'EVAL()' Statement...
But, hum, I'm not completely sure if the 'EVENT' Mode for iMB v12.0 supports the 'KEY' Parameter for the 'KEYPRESS' Command, ah-ah...!
What you are saying about the site makes sense, I hate using this website, it's such a terrible format for reporting.
I did try to create a chart of what POS each day is on but the problem is the next day when I go in, those same days have a new POS :roll:


If I were to give you login could you take a look at it and see if you can figure something out with the calendar?

Steps to get to calendar:
-Click on Xformity, new tab should open
-In the bottom left corner there is a button that has a number, push this button to open calender widget.

THANKS!!

Re: Relative Positioning Only Works Sometimes

Posted: Thu Jul 19, 2018 9:42 pm
by chivracq
senor pengwin wrote:What you are saying about the site makes sense, I hate using this website, it's such a terrible format for reporting.
I did try to create a chart of what POS each day is on but the problem is the next day when I go in, those same days have a new POS :roll:

If I were to give you login could you take a look at it and see if you can figure something out with the calendar?
I am going to leave here for a little bit if you are able to write it down and I can remove it:
https://dennys.onelogin.com/portal/
User: xxx
PW: xxx

Steps to get to calendar:
-Click on Xformity, new tab should open
-In the bottom left corner there is a button that has a number, push this button to open calender widget.

THANKS!!
OK, I'm in...!, Site didn't like my Browser (Pale Moon v26.3.3), but I managed to get inside anyway...
And I found the Calendar... :D

(Some easy+"discrete" way to give me some L&P if you don't want to post them on the Forum is to "report" any Post from the Thread and you can leave a "Comment", I'm the only one then who can see the Report/your Comment... (+ the Forum Admin of course)...)

Re: Reative Positioning Only Works Sometimes

Posted: Thu Jul 19, 2018 10:04 pm
by senor pengwin
chivracq wrote: OK, I'm in...!, Site didn't like my Browser (Pale Moon v26.3.3), but I managed to get inside anyway...
And I found the Calendar... :D

(Some easy+"discrete" way to give me some L&P if you don't want to post them on the Forum is to "report" any Post from the Thread and you can leave a "Comment", I'm the only one then who can see the Report/your Comment... (+ the Forum Admin of course)...)
Great! That's a good idea, I will try next time (if there is one :oops: )

Thanks again!

Re: Relative Positioning Only Works Sometimes

Posted: Thu Jul 19, 2018 11:04 pm
by chivracq
Okay, pfff...!, much easier indeed if I can "play" with the Page myself, ah-ah...!

Alright, this one should work... I think..., until just after 2039-01-01...!, if the Site survives the 'POSIX' Bug, ah-ah...!! :wink:

Code: Select all

VERSION BUILD=8820413 RECORDER=FX
TAB T=1
'URL GOTO=https://dennysnew.xformity.com/interface.aspx
'TAG POS=1 TYPE=TD ATTR=ID:calTitleF
TAG POS=1 TYPE=TD ATTR=ID:calTitle
TAG POS=R-1 TYPE=TD ATTR=DATA-T:*1*&&TXT:4

TAG POS=1 TYPE=TD ATTR=ID:calTitle
TAG POS=R1 TYPE=TD ATTR=DATA-T:*1*&&TXT:16
(Tested on iMacros for FF v8.8.2, PM 26.3.3 (=FF47), Win10_x64.)

The Reason for your 'POS=3' '=4' is that both Calendars have 35 Cells (=7x5), with only [28-31] Days visible, depending on the Month, but the first Cells at the beginning of a Month still contain '31'/'30'/'29'/etc from the previous Month if the '1' is not a 'Sunday' included in the Grid, even if they are not visible, same thing at the end of a Month if there are still a few Cells available with '1'/'2'/'3'/etc belonging to the next Month...

But, the good News is that the valid/visible Days have some extra 'data-t' Argument that the invisible Cells don't have, and the "DATA-T:*1*" extra Argument I added to your Script makes sure that your Script will keep working for about 7500 Days, ah-ah...!, plus from time to time after Jan 2039, when there will be a "1" in the 5 Digit-Nb identifying each Day in the weird System that Widget is using... 8)

The 'R-1' and 'R1' both on the same 'calTitle' Element (which is the Month Header for the 'To' Calendar below) make sure that 02-30 (30th of Feb) or 06-31 (31st of June) for the 'From' Date won't select anything as those Dates do not exist...!
Using 'R1' for both and based on 'calTitleF' for the 'From' Date would select otherwise 31-07 in the 'To' Date for 'TXT:31', oops....!

And you only need to specify [1-31] with your original Vars like you had in the Script in your OP... 8)
And the 'From' Calendar doesn't even need to be open for the 'From' Date to work... 8)

[And I'm logged out of your Site...]

>>>

Arrgghhh...!, stg I only realize "now"...: Could you correct the Typo in your Thread Title about "Re[l]ative"...!? :mrgreen:
(Otherwise other Users searching the Forum with "Relative Positioning" as Search Keywords won't find this (interesting) Thread...) You got "lucky" I didn't notice it earlier, I wouldn't have started doing anything on this Case/Thread until it had been corrected...

Re: Relative Positioning Only Works Sometimes

Posted: Fri Jul 20, 2018 12:21 am
by senor pengwin
chivracq wrote:Okay, pfff...!, much easier indeed if I can "play" with the Page myself, ah-ah...!

Alright, this one should work... I think..., until just after 2039-01-01...!, if the Site survives the 'POSIX' Bug, ah-ah...!! :wink:

Code: Select all

VERSION BUILD=8820413 RECORDER=FX
TAB T=1
'URL GOTO=https://dennysnew.xformity.com/interface.aspx
'TAG POS=1 TYPE=TD ATTR=ID:calTitleF
TAG POS=1 TYPE=TD ATTR=ID:calTitle
TAG POS=R-1 TYPE=TD ATTR=DATA-T:*1*&&TXT:4

TAG POS=1 TYPE=TD ATTR=ID:calTitle
TAG POS=R1 TYPE=TD ATTR=DATA-T:*1*&&TXT:16
(Tested on iMacros for FF v8.8.2, PM 26.3.3 (=FF47), Win10_x64.)

The Reason for your 'POS=3' '=4' is that both Calendars have 35 Cells (=7x5), with only [28-31] Days visible, depending on the Month, but the first Cells at the beginning of a Month still contain '31'/'30'/'29'/etc from the previous Month if the '1' is not a 'Sunday' included in the Grid, even if they are not visible, same thing at the end of a Month if there are still a few Cells available with '1'/'2'/'3'/etc belonging to the next Month...

But, the good News is that the valid/visible Days have some extra 'data-t' Argument that the invisible Cells don't have, and the "DATA-T:*1*" extra Argument I added to your Script makes sure that your Script will keep working for about 7500 Days, ah-ah...!, plus from time to time after Jan 2039, when there will be a "1" in the 5 Digit-Nb identifying each Day in the weird System that Widget is using... 8)

The 'R-1' and 'R1' both on the same 'calTitle' Element (which is the Month Header for the 'To' Calendar below) make sure that 02-30 (30th of Feb) or 06-31 (31st of June) for the 'From' Date won't select anything as those Dates do not exist...!
Using 'R1' for both and based on 'calTitleF' for the 'From' Date would select otherwise 31-07 in the 'To' Date for 'TXT:31', oops....!

And you only need to specify [1-31] with your original Vars like you had in the Script in your OP... 8)
And the 'From' Calendar doesn't even need to be open for the 'From' Date to work... 8)

[And I'm logged out of your Site...]

>>>

Arrgghhh...!, stg I only realize "now"...: Could you correct the Typo in your Thread Title about "Re[l]ative"...!? :mrgreen:
(Otherwise other Users searching the Forum with "Relative Positioning" as Search Keywords won't find this (interesting) Thread...) You got "lucky" I didn't notice it earlier, I wouldn't have started doing anything on this Case/Thread until it had been corrected...
Fixed!! So sorry I didn’t notice it ether, just a typo!

As always, brilliant! I will need to read over this a couple more times to fully understand, once I get home I will test it out.

Thanks again

Re: Relative Positioning Only Works Sometimes

Posted: Fri Jul 20, 2018 12:58 am
by chivracq
senor pengwin wrote:Fixed!! So sorry I didn’t notice it ether, just a typo!

As always, brilliant! I will need to read over this a couple more times to fully understand, once I get home I will test it out.

Thanks again
Yeah, for the Typo in your Thread Title, I've corrected it in all my previous Posts, and as I quote all Content from the/your previous Reply each time, both your + my Content(s) are "searchable"...

Yeah, well, "brilliant", I don't know, check it first to see if it works indeed correctly, ah-ah...! :idea:

I only "handled" selecting a (valid/existing) Day for the/that Month for both Calendars, using the shortest and simplest Solution, the Page has a lot of Background JS and Data/Input/Content Validation, but the rest looked pretty straightforward to me, shouldn't be very difficult... 8)

Re: Relative Positioning Only Works Sometimes

Posted: Fri Jul 20, 2018 3:20 pm
by senor pengwin
chivracq wrote:
senor pengwin wrote:Fixed!! So sorry I didn’t notice it ether, just a typo!

As always, brilliant! I will need to read over this a couple more times to fully understand, once I get home I will test it out.

Thanks again
Yeah, for the Typo in your Thread Title, I've corrected it in all my previous Posts, and as I quote all Content from the/your previous Reply each time, both your + my Content(s) are "searchable"...

Yeah, well, "brilliant", I don't know, check it first to see if it works indeed correctly, ah-ah...! :idea:

I only "handled" selecting a (valid/existing) Day for the/that Month for both Calendars, using the shortest and simplest Solution, the Page has a lot of Background JS and Data/Input/Content Validation, but the rest looked pretty straightforward to me, shouldn't be very difficult... 8)
I tested it and it works like a charm! This website only allows me to export 400 lines in an Excel file at a time so I had fun last night writing something that would export reports in group's if they go over 400 lines, but it's all working great now.

Just a couple questions to get a better understanding.

-So on the "From" calendar you used R-1 because you actually selected the "To" calendar but R-1 makes it select the POS before the one I selected correct?

-What is the need for using the && in the line after ATTR and where does the *1* come from?

Thanks again!

Re: Relative Positioning Only Works Sometimes

Posted: Fri Jul 20, 2018 4:31 pm
by chivracq
senor pengwin wrote:
chivracq wrote:
senor pengwin wrote:Fixed!! So sorry I didn’t notice it ether, just a typo!

As always, brilliant! I will need to read over this a couple more times to fully understand, once I get home I will test it out.

Thanks again
Yeah, for the Typo in your Thread Title, I've corrected it in all my previous Posts, and as I quote all Content from the/your previous Reply each time, both your + my Content(s) are "searchable"...

Yeah, well, "brilliant", I don't know, check it first to see if it works indeed correctly, ah-ah...! :idea:

I only "handled" selecting a (valid/existing) Day for the/that Month for both Calendars, using the shortest and simplest Solution, the Page has a lot of Background JS and Data/Input/Content Validation, but the rest looked pretty straightforward to me, shouldn't be very difficult... 8)
I tested it and it works like a charm! This website only allows me to export 400 lines in an Excel file at a time so I had fun last night writing something that would export reports in group's if they go over 400 lines, but it's all working great now.
OK, good to hear... :D

Interesting Case/Site for me as well, I have to say..., as I don't use any Calendar Functionality for myself in any of my own Scripts, then with Cases/Sites like yours, I can keep a bit up-to-date with "new" Developments and different Techniques used in Web-Development, and how to handle such Pages/Objects with iMacros, ah-ah...! 8)
senor pengwin wrote:Just a couple questions to get a better understanding.

-So on the "From" calendar you used R-1 because you actually selected the "To" calendar but R-1 makes it select the POS before the one I selected correct?
Yep, like I explained, I used the Month Header of the 'To' Calendar (+ 'R-1' then indeed), to make sure that the first 'From' Date would only pick up a Day from the 'From' Calendar..., or like I already mentioned, trying to select '31' on the 'June' Month (which only has 30 Days), could have selected the '31' for July from the 'To' Calendar if the 'To' Calendar was opened on 'July'.

Instead of using 'R-1', another Solution could be to use '!ENDOFPAGE' for you as you are on iMB, but I am on FF where '!ENDOFPAGE' is not supported, then I wouldn't have been able to test..., then I prefer to use my own "Workaround"..., and your Script will work in all Browsers and not only on iMB... 8)
senor pengwin wrote:-What is the need for using the && in the line after ATTR and where does the *1* come from?

Thanks again!
The '&&' is to combined several Attributes in the same 'TAG' Statement...
Record once tagging on any HTML Object on some Page, using the 'Expert Full HTML' Mode, and iMacros will attempt to record all possible Attributes it/you could use to tag that Element.

This is what I used to understand how the Day Elements were coded on this Page:

Code: Select all

<td style="outline: 1px solid blue;" data-d="y">29</td>
<td style="outline: 1px solid blue;" data-d="y">29</td>
<td style="outline: 1px solid blue;" data-t="12578" class="bgrtxt me" data-bgtxt="P7">29</td>

<td style="outline: 1px solid blue;" data-d="y">28</td>
<td style="outline: 1px solid blue;" class="me" data-t="12457">28</td>
<td style="outline: 1px solid blue;" data-d="y">28</td>
<td style="outline: 1px solid blue;" data-t="12577">28</td>

<td style="outline: 1px solid blue;" class="" data-t="12456">27</td>
<td style="outline: 1px solid blue;" data-d="y">27</td>
<td style="outline: 1px solid blue;" data-t="12576">27</td>

<td style="outline: 1px solid blue;" data-t="12455">26</td>
<td style="outline: 1px solid blue;" data-t="12575">26</td>
Like that I could identify that all invisible Days had some [data-d="y"] Attribute, => that I wanted to avoid explicitly...
The visible Days had some [data-t="12575"] Attr for example for 2018-07-26...
The Days with the Red Spot as a result of the 'Current Day' Button (or after using the '+1' and/or '-1' Buttons) had some [class="me"] Attr for the 'From' Cal and [class="bgrtxt me"] for the 'To' Cal.

=> The [*1*] for the 'data-t' Attr comes from the 5 Digits identifying each Day... You could use [*12*] as well if you prefer, but your Script will then only work until '12999', for about another 425 Days, which is about 1 Year and 2 Months, until Septb 2019..., I chose for only the '1', which allows the Script to keep working for 7425 Days, until 2039, therefore surviving the 'POSIX' Bug, gniarf-gniarf...!, like I already mentioned... :wink:

Re: Relative Positioning Only Works Sometimes

Posted: Thu Jul 26, 2018 5:45 am
by senor pengwin
chivracq wrote: The '&&' is to combined several Attributes in the same 'TAG' Statement...
Record once tagging on any HTML Object on some Page, using the 'Expert Full HTML' Mode, and iMacros will attempt to record all possible Attributes it/you could use to tag that Element.

This is what I used to understand how the Day Elements were coded on this Page:

Code: Select all

<td style="outline: 1px solid blue;" data-d="y">29</td>
<td style="outline: 1px solid blue;" data-d="y">29</td>
<td style="outline: 1px solid blue;" data-t="12578" class="bgrtxt me" data-bgtxt="P7">29</td>

<td style="outline: 1px solid blue;" data-d="y">28</td>
<td style="outline: 1px solid blue;" class="me" data-t="12457">28</td>
<td style="outline: 1px solid blue;" data-d="y">28</td>
<td style="outline: 1px solid blue;" data-t="12577">28</td>

<td style="outline: 1px solid blue;" class="" data-t="12456">27</td>
<td style="outline: 1px solid blue;" data-d="y">27</td>
<td style="outline: 1px solid blue;" data-t="12576">27</td>

<td style="outline: 1px solid blue;" data-t="12455">26</td>
<td style="outline: 1px solid blue;" data-t="12575">26</td>
Like that I could identify that all invisible Days had some [data-d="y"] Attribute, => that I wanted to avoid explicitly...
The visible Days had some [data-t="12575"] Attr for example for 2018-07-26...
The Days with the Red Spot as a result of the 'Current Day' Button (or after using the '+1' and/or '-1' Buttons) had some [class="me"] Attr for the 'From' Cal and [class="bgrtxt me"] for the 'To' Cal.

=> The [*1*] for the 'data-t' Attr comes from the 5 Digits identifying each Day... You could use [*12*] as well if you prefer, but your Script will then only work until '12999', for about another 425 Days, which is about 1 Year and 2 Months, until Septb 2019..., I chose for only the '1', which allows the Script to keep working for 7425 Days, until 2039, therefore surviving the 'POSIX' Bug, gniarf-gniarf...!, like I already mentioned... :wink:

Thanks for info, the && makes sense now that I have done a little more diving into some websites html and just playing around with grabbing things in iMacros, also going over the Wiki a few more times. Expert recorder is a nice tool as well, just found out about it when you mentioned it :oops: But it's still working great so I haven't made any changes, even though the clock is ticking..