Same position, different attributes

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Same position, different attributes

by BarryTheBaptist on Tue Nov 28, 2017 9:17 am

Hello,

I'm looking for some help due to certain extraction from a website.
When I try to extract this info I receive this code TAG POS=1 TYPE=A ATTR=TXT:12578455 and this number changes constantly, auto generated based on task, after clicking on it, it basically, disappears until new task is created.
Is there any solution that macros would be able to click on it no matter what ID is. Please advise.

Thanks!
BarryTheBaptist
 
Posts: 4
Joined: Tue Nov 28, 2017 8:45 am

Re: Same position, different attributes

by chivracq on Tue Nov 28, 2017 10:04 am

BarryTheBaptist wrote:Hello,

I'm looking for some help due to certain extraction from a website.
When I try to extract this info I receive this code TAG POS=1 TYPE=A ATTR=TXT:12578455 and this number changes constantly, auto generated based on task, after clicking on it, it basically, disappears until new task is created.
Is there any solution that macros would be able to click on it no matter what ID is. Please advise.

Thanks!

CIM...! :mrgreen: (Read my Sig...)

Hum, "info" is a bit vague in"extract this info", and a bit contradictory with "would be able to click on it", so it's not clear if you want to extract that Link or to click on it... :?
But in order to tag your Link to extract whatever "Info" you want from it, or to click on it, you can use a Wildcard on the 'TXT' Attribute (and you then might have to adjust the 'POS=n' Parameter), maybe combined with "Relative Positioning" to try to keep the 'POS=n' as low as possible, hopefully/ideally as "POS=R1"... (And this sounds like the Sol you need from your Case Description...)
Or identify and use some other Attribute(s) for that Link rather than only the 'TXT' Attibute, => Class / ID / HREF for example, maybe combined with Wildcards if any part might be Dynamic...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6474
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Same position, different attributes

by BarryTheBaptist on Tue Nov 28, 2017 10:25 am

Thank you for the reply and sorry I'm new to imacros. I'm trying to click on it. Function of this macro would be just to refresh the website until mentioned tasks appear and click on it but as I mentioned I'm having trouble with prerecording it since for every new task, there's a different, randomly generated ID.
BarryTheBaptist
 
Posts: 4
Joined: Tue Nov 28, 2017 8:45 am

Re: Same position, different attributes

by chivracq on Tue Nov 28, 2017 2:35 pm

BarryTheBaptist wrote:Thank you for the reply and sorry I'm new to imacros. I'm trying to click on it. Function of this macro would be just to refresh the website until mentioned tasks appear and click on it but as I mentioned I'm having trouble with prerecording it since for every new task, there's a different, randomly generated ID.

Yeah, but sorry, you missed the "CIM" part for me to follow up... :idea:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6474
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Same position, different attributes

by BarryTheBaptist on Tue Nov 28, 2017 4:44 pm

My bad...

iMacros for Firefox 9.0.3
Firefox 55.0.2
Windows 10 64x

This is a recording of already accepted tasks, for upcoming ones, ID is unknown....
VERSION BUILD=9030808 RECORDER=FX
TAB T=1
REFRESH
wait seconds=5
FRAME NAME="_TOP_MENU"
TAG POS=1 TYPE=FONT ATTR=TXT:PENDING<SP>ORDERS
TAG POS=1 TYPE=A ATTR=TXT:12578455
FRAME NAME="_TOP_MENU"
TAG POS=1 TYPE=FONT ATTR=TXT:PENDING<SP>ORDERS
FRAME F=0
TAG POS=1 TYPE=A ATTR=TXT:12578287
FRAME NAME="_TOP_MENU"
TAG POS=1 TYPE=FONT ATTR=TXT:PENDING<SP>ORDERS
FRAME F=0
TAG POS=1 TYPE=A ATTR=TXT:12577697
FRAME NAME="_TOP_MENU"
TAG POS=1 TYPE=FONT ATTR=TXT:PENDING<SP>ORDERS
BarryTheBaptist
 
Posts: 4
Joined: Tue Nov 28, 2017 8:45 am

Re: Same position, different attributes

by chivracq on Tue Nov 28, 2017 5:49 pm

BarryTheBaptist wrote:My bad...

Code: Select all
iMacros for Firefox 9.0.3
Firefox 55.0.2
Windows 10 64x


This is a recording of already accepted tasks, for upcoming ones, ID is unknown....
Code: Select all
VERSION BUILD=9030808 RECORDER=FX
TAB T=1
REFRESH
wait seconds=5
FRAME NAME="_TOP_MENU"
TAG POS=1 TYPE=FONT ATTR=TXT:PENDING<SP>ORDERS
TAG POS=1 TYPE=A ATTR=TXT:12578455
FRAME NAME="_TOP_MENU"
TAG POS=1 TYPE=FONT ATTR=TXT:PENDING<SP>ORDERS
FRAME F=0
TAG POS=1 TYPE=A ATTR=TXT:12578287
FRAME NAME="_TOP_MENU"
TAG POS=1 TYPE=FONT ATTR=TXT:PENDING<SP>ORDERS
FRAME F=0
TAG POS=1 TYPE=A ATTR=TXT:12577697
FRAME NAME="_TOP_MENU"
TAG POS=1 TYPE=FONT ATTR=TXT:PENDING<SP>ORDERS

OK, FCI mentioned, now we can "talk"... (Sorry but I usually don't even read the Qt if that Info is not mentioned, and certainly don't answer..., or only once for first time Posters...)

And Script is posted, that's even better, now I have a better Idea, even if I could have a look myself at the Page would even be better...

So, then yep..., like I said, you need to use a Wildcard for the changing part...
Try this one already...:
Code: Select all
FRAME F=0
TAG POS=1 TYPE=A ATTR=TXT:1257*
FRAME NAME="_TOP_MENU"
TAG POS=1 TYPE=FONT ATTR=TXT:PENDING<SP>ORDERS

... But you might have to adapt the 'POS=n' for the Link like I already said...

And if that doesn't work exactly like you want, then like I already mentioned as well..., you can use Relative Positioning by first tagging some HTML Field, some Text Header or Label that won't change and which is located close to your Link(s) to use as Anchor (and which I think needs to be located in the same Frame like your Link)...:
Code: Select all
FRAME F=0
TAG POS=1 TYPE=DIV/SPAN - I don't know, tag the Field you want to use as Anchor for Relative Positioning...
TAG POS=R1 TYPE=A ATTR=TXT:1257*
FRAME NAME="_TOP_MENU"
TAG POS=1 TYPE=FONT ATTR=TXT:PENDING<SP>ORDERS
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6474
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Same position, different attributes

by BarryTheBaptist on Wed Nov 29, 2017 1:21 pm

FRAME F=0
TAG POS=1 TYPE=A ATTR=TXT:1257*
FRAME NAME="_TOP_MENU"
TAG POS=1 TYPE=FONT ATTR=TXT:PENDING<SP>ORDERS

This one did the trick.

Thank you soooooo much!!
BarryTheBaptist
 
Posts: 4
Joined: Tue Nov 28, 2017 8:45 am

Re: Same position, different attributes

by chivracq on Wed Nov 29, 2017 2:50 pm

BarryTheBaptist wrote:
Code: Select all
FRAME F=0
TAG POS=1 TYPE=A ATTR=TXT:1257*
FRAME NAME="_TOP_MENU"
TAG POS=1 TYPE=FONT ATTR=TXT:PENDING<SP>ORDERS


This one did the trick.

Thank you soooooo much!!

Ah OK, was a bit of a "lucky" Spear in the Water to catch a Fish, always difficult without being to "play" with the Page myself... 8)

Be aware that the "1257*" Range for your Links will probably one day be exhausted and you'll have to switch to "1258*" or remove the last Digit like in "125*"... Using Relative Positioning would probably have been more "reliable"... :idea:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6474
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to General Support & Discussions

Who is online

Users browsing this forum: No registered users and 8 guests

-->