IEGetTagByAttribut not working

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
PeVo
Newbie
Posts: 2
Joined: Tue Jan 22, 2019 3:59 pm

IEGetTagByAttribut not working

Post by PeVo » Tue Jan 22, 2019 4:41 pm

I'm attempting to scrap a webpage with a progress bar that updates as I answer questions. The progress bar moves around depending on screen resolution (sometime I run this on a low-res laptop, sometimes my desktop with a 1080p screen) so using coordinates has been unsuccessful/inconsistent.

The progress bar value is consistently labelled though. I was hoping MacroScheduler could scan over the HTML, find a specific DIV tag, and click the contents. I can do all the copy/paste/evaluation stuff myself after. I just need MacroScheduler to identify the text at that DIV each time.

Basically, the HTML on page is;
<div class="sc-progperc"><span id="scProgressText">0</span>% <span class="sc-inv">complete</div>

Where 0 is the value I want MacroScheduler to find and click/focus/select. Anything so I can copy that value into the Clipboard.

I've been trying to use IEGetTagsByAttrib but it constantly fails. I get the error message: Error in __debug.dbg, No matching IE instance found.

The instance is very much real, I load the webpage myself first and even use a SetFocus earlier in the macro to ensure the page is active. The more I read, the more it sounds like I can't just use IEGetTags unless I make MacroScheduler also launch IE and load the page itself? Maybe this is wrong too?

Hopefully this illustrates what I'm stuck on (trying to select that 0 in the 0% complete HTML example). Any advice is appreciated!

User avatar
Marcus Tettmar
Site Admin
Posts: 7054
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: IEGetTagByAttribut not working

Post by Marcus Tettmar » Tue Jan 22, 2019 10:30 pm

IEGetTagsByAttrib requires the URL of the browser. If the element is inside a frame the URL may not be what you think it is.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

PeVo
Newbie
Posts: 2
Joined: Tue Jan 22, 2019 3:59 pm

Re: IEGetTagByAttribut not working

Post by PeVo » Wed Jan 23, 2019 2:11 pm

Interesting suggestion, thank-you.

There are frames on the page. So if I understand this correctly, even if I've set focus to the browser, I still need to reference the URL for Macro Scheduler to skim over the html and look for the tag I want to access? There's no way to get MS to just skim over the current active page and look for the tag?

If so, how would I figure out what the URL truly is if there are frames?

I hope my question is clear, I don't feel like I'm expecting something wild from the tool? I just want it to look over the HTML, find the DIV with a specific label and extract that value.

Thanks again for the help!

User avatar
Marcus Tettmar
Site Admin
Posts: 7054
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: IEGetTagByAttribut not working

Post by Marcus Tettmar » Wed Jan 23, 2019 10:29 pm

Only a unique part of the URL is needed - a substring works. If you use the tag inspector (developer tools - F12) you can find the frame/iframe and locate the source url.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply