[Editor] Browser Automation Macro Editor (TagIE)

Post your working scripts, libraries and tools
leosouza85
Posts: 39
Joined: 22 Jul 2016, 16:28

Re: [Editor] Browser Automation Macro Editor (TagIE)

01 Dec 2018, 09:55

adegard wrote:
01 Dec 2018, 04:57
@leosouza85,
ok I will add a TagIE function for that... Give me some days
I think it's possible also to record frames levels in iMacros. Then it could be much easier to pass it to tagIE with selectors already done. :P
Yes it is possible maybe a function to autoconnect to the frame in ahk :-)
burque505
Posts: 1242
Joined: 22 Jan 2017, 19:37

Re: [Editor] Browser Automation Macro Editor (TagIE)

01 Dec 2018, 19:55

Hi, I was trying to get the IE_Selector tools to look a little better on screen, primarily so you can see the whole tag.
I found the script on a site that was in a language I didn't understand, and it doesn't have any comments in it to speak of, but it doesn't look like it was decompiled or anything, it's nicely indented.
I wasn't able to translate the script to AHK, it's too much for me :(.

I was able to change the size of the edit box and add vertical scroll, but that's about it. Now, at least, you can see the whole selector (most of the time).
I have noticed, by the way, since we're talking about frames, that the IE_Selector tools will choke on frames.
Here's what it looks like, and the compiled tools are attached zipped up.

EDIT: Changed the icon with Resource Hacker.
new_selector.GIF
new_selector.GIF (17.35 KiB) Viewed 3583 times
Attachments
IE_Selector_2018.zip
(1.24 MiB) Downloaded 51 times
User avatar
adegard
Posts: 87
Joined: 24 Nov 2017, 05:58
GitHub: adegard

Re: [Editor] Browser Automation Macro Editor (TagIE)

02 Dec 2018, 09:29

@burque505, thanks for help, I share here the original autoit code by @Chimp : https://www.autoitscript.com/forum/topi ... ctor-tool/

It's a javascript injection, someone could give some help on transcript it in ahk? Also I could ask to @Chimp itself in AutoIt forum...

I have problems with .exe files with my antivirus, it put it always in quarantine, so having IE_selector in ahk could be safer for everyone...

Thanks again, any help you can do! :wave:
User avatar
adegard
Posts: 87
Joined: 24 Nov 2017, 05:58
GitHub: adegard

Re: [Editor] Browser Automation Macro Editor (TagIE)

02 Dec 2018, 10:25

New Release:
- in iMacros_converter tool:
during convertion of iMacros code, the converter add twaitSelector() befor tclick and tenter, which check selector presence. So there's no need to add Sleep.

PS : iMacros converter is still beta version, please contribute to improve! :headwall:
User avatar
adegard
Posts: 87
Joined: 24 Nov 2017, 05:58
GitHub: adegard

Re: [Editor] Browser Automation Macro Editor (TagIE)

02 Dec 2018, 12:25

leosouza85 wrote:
30 Nov 2018, 15:06
Wonderful work!!! Really hope that someday it will work with frames and multilevel frames :-D
@leosouza85 : I worked on a simple 1 frame page of bing and tried to access on a button, using informations recorded by iMacros, and it works:

iMacros code:

Code: Select all

VERSION BUILD=1005 RECORDER=CR
URL GOTO=https://www.bing.com/images/search?q=elderly&FORM=QBIR
TAG SELECTOR="#mmComponent_images_1>UL>LI>DIV>DIV>A>DIV>IMG"
FRAME F=1
TAG SELECTOR="#actionbar>UL>LI:nth-of-type(2)>DIV>DIV>SPAN>SPAN:nth-of-type(2)"
TagIE/Autohotkey that works is: :D

Code: Select all

#include TagIE.ahk  ;download the last version of TagIE_Editor and put the code inside
 
tnav("https://www.bing.com/images/search?pq=el&sc=8-2&cvid=95FC2125AED84EA6A93F6FC1B424F0E3&sp=1&q=elderly&qft=+filterui:license-L2_L3&FORM=IRFLTR", "")
twaitSelector("#mmComponent_images_1>UL>LI>DIV>DIV>A>DIV>IMG")
tclick("#mmComponent_images_1>UL>LI>DIV>DIV>A>DIV>IMG")

;ACCESS NOW TO THE BUTTON ON IFRAME:

;just to be sure I'm on IE
    WinActivate ahk_class IEFrame
    ControlFocus, Internet Explorer_Server1, ahk_class IEFrame
    ;WinGetTitle, WinTitle, A 
    pwb := PWB_Init(WinTitle) ; replaces WinGetTitle and PWB_Get()

;Get first iframe id (because I don't want to use iWB2_learner tool, just convert iMacros in future)
myid :=pwb.document.all.tags("IFRAME")[0].getAttribute("id")
;MsgBox, %myid%

;Click on Selector in frame 1
pwb.document.parentWindow.frames(myid).document.querySelectorAll("#actionbar>UL>LI:nth-of-type(2)>DIV>DIV>SPAN>SPAN:nth-of-type(2)")[0].click() 

ExitApp 
Esc::ExitApp

At this point:
- I will put a new function in TagIE to give access to one-level iframe,
- update iMacros converter program to adapt it when I see "FRAME=1" starting with iframe codes...
- Search also to access to multi-level
leosouza85
Posts: 39
Joined: 22 Jul 2016, 16:28

Re: [Editor] Browser Automation Macro Editor (TagIE)

02 Dec 2018, 12:44

adegard wrote:
02 Dec 2018, 12:25
leosouza85 wrote:
30 Nov 2018, 15:06
Wonderful work!!! Really hope that someday it will work with frames and multilevel frames :-D
@leosouza85 : I worked on a simple 1 frame page of bing and tried to access on a button, using informations recorded by iMacros, and it works:

iMacros code:

Code: Select all

VERSION BUILD=1005 RECORDER=CR
URL GOTO=https://www.bing.com/images/search?q=elderly&FORM=QBIR
TAG SELECTOR="#mmComponent_images_1>UL>LI>DIV>DIV>A>DIV>IMG"
FRAME F=1
TAG SELECTOR="#actionbar>UL>LI:nth-of-type(2)>DIV>DIV>SPAN>SPAN:nth-of-type(2)"
TagIE/Autohotkey that works is: :D

Code: Select all

#include TagIE.ahk  ;download the last version of TagIE_Editor and put the code inside
 
tnav("https://www.bing.com/images/search?pq=el&sc=8-2&cvid=95FC2125AED84EA6A93F6FC1B424F0E3&sp=1&q=elderly&qft=+filterui:license-L2_L3&FORM=IRFLTR", "")
twaitSelector("#mmComponent_images_1>UL>LI>DIV>DIV>A>DIV>IMG")
tclick("#mmComponent_images_1>UL>LI>DIV>DIV>A>DIV>IMG")

;ACCESS NOW TO THE BUTTON ON IFRAME:

;just to be sure I'm on IE
    WinActivate ahk_class IEFrame
    ControlFocus, Internet Explorer_Server1, ahk_class IEFrame
    ;WinGetTitle, WinTitle, A 
    pwb := PWB_Init(WinTitle) ; replaces WinGetTitle and PWB_Get()

;Get first iframe id (because I don't want to use iWB2_learner tool, just convert iMacros in future)
myid :=pwb.document.all.tags("IFRAME")[0].getAttribute("id")
;MsgBox, %myid%

;Click on Selector in frame 1
pwb.document.parentWindow.frames(myid).document.querySelectorAll("#actionbar>UL>LI:nth-of-type(2)>DIV>DIV>SPAN>SPAN:nth-of-type(2)")[0].click() 

ExitApp 
Esc::ExitApp

At this point:
- I will put a new function in TagIE to give access to one-level iframe,
- update iMacros converter program to adapt it when I see "FRAME=1" starting with iframe codes...
- Search also to access to multi-level
fantastic! thank you so much!
User avatar
adegard
Posts: 87
Joined: 24 Nov 2017, 05:58
GitHub: adegard

Re: [Editor] Browser Automation Macro Editor (TagIE)

02 Dec 2018, 13:30

Your welcome! I just upload a new version

I added frame parameter to all function:
-click on element, frame number(0:disabled)
tclick("ele", 0)
-Get element value, in frame (0:disabled)
var:=tread("ele", 0)
-Enter value in element, in frame (0:disabled)
tenter("val", "ele", 0)
-Wait for Selector, frame number (0:disabled)
twaitSelector("selector", 0)
-Select value, in frame (0:disabled)
tselect("ele", "value", 0)
-scroll to element, in frame (0:disabled)
tscroll("ele", 0)

Then in my above example, converter give:

Code: Select all

#include TagIE.ahk 
frame := 0 
 
tnav("https://www.bing.com/images/search?q=elderly&FORM=QBIR", "")
twaitSelector("#mmComponent_images_1>UL>LI>DIV>DIV>A>DIV>IMG", frame)
tclick("#mmComponent_images_1>UL>LI>DIV>DIV>A>DIV>IMG", frame)
frame := 1 
twaitSelector("#actionbar>UL>LI:nth-of-type(2)>DIV>DIV>SPAN>SPAN:nth-of-type(2)", frame)
tclick("#actionbar>UL>LI:nth-of-type(2)>DIV>DIV>SPAN>SPAN:nth-of-type(2)", frame)

ExitApp 
Esc::ExitApp
Now I need to update all examples! :roll:
burque505
Posts: 1242
Joined: 22 Jan 2017, 19:37

Re: [Editor] Browser Automation Macro Editor (TagIE)

02 Dec 2018, 15:42

Very nice, adegard!
Regards,
burque505
EDIT: Can you tell me how you got the tags for the frame? IE_Selector.exe isn't finding them for me (Win7 64-bit here).
Thanks!
I meant these, by the way.

Code: Select all

#mmComponent_images_1>UL>LI>DIV>DIV>A>DIV>IMG
and

Code: Select all

#actionbar>UL>LI:nth-of-type(2)>DIV>DIV>SPAN>SPAN:nth-of-type(2)
leosouza85
Posts: 39
Joined: 22 Jul 2016, 16:28

Re: [Editor] Browser Automation Macro Editor (TagIE)

02 Dec 2018, 16:27

adegard wrote:
02 Dec 2018, 13:30
Your welcome! I just upload a new version

I added frame parameter to all function:
-click on element, frame number(0:disabled)
tclick("ele", 0)
-Get element value, in frame (0:disabled)
var:=tread("ele", 0)
-Enter value in element, in frame (0:disabled)
tenter("val", "ele", 0)
-Wait for Selector, frame number (0:disabled)
twaitSelector("selector", 0)
-Select value, in frame (0:disabled)
tselect("ele", "value", 0)
-scroll to element, in frame (0:disabled)
tscroll("ele", 0)

Then in my above example, converter give:

Code: Select all

#include TagIE.ahk 
frame := 0 
 
tnav("https://www.bing.com/images/search?q=elderly&FORM=QBIR", "")
twaitSelector("#mmComponent_images_1>UL>LI>DIV>DIV>A>DIV>IMG", frame)
tclick("#mmComponent_images_1>UL>LI>DIV>DIV>A>DIV>IMG", frame)
frame := 1 
twaitSelector("#actionbar>UL>LI:nth-of-type(2)>DIV>DIV>SPAN>SPAN:nth-of-type(2)", frame)
tclick("#actionbar>UL>LI:nth-of-type(2)>DIV>DIV>SPAN>SPAN:nth-of-type(2)", frame)

ExitApp 
Esc::ExitApp
Now I need to update all examples! :roll:
thankyou so much!

Huum the imacros converter seems not working for me...
it puts frame :=4
and then only repeats the imacros code

EDIT: my mistake... css selectors were unmarked
User avatar
adegard
Posts: 87
Joined: 24 Nov 2017, 05:58
GitHub: adegard

Re: [Editor] Browser Automation Macro Editor (TagIE)

03 Dec 2018, 05:59

@burque505:
EDIT: Can you tell me how you got the tags for the frame? IE_Selector.exe isn't finding them for me (Win7 64-bit here).
To get iframes selectors, I used a recorded script from iMacros (use css checked in 'settings') and convert it in TagiE with the tool iMacros_TagIE_converter... :)
IE_selector doesn't give iframe selector...

@leosouza85:
Do you try it on other iframes?
It's just working with single level iframe for now... (not "multilevel", I need to implement the code to do it) :?
leosouza85
Posts: 39
Joined: 22 Jul 2016, 16:28

Re: [Editor] Browser Automation Macro Editor (TagIE)

03 Dec 2018, 07:19

adegard wrote:
03 Dec 2018, 05:59
@burque505:
EDIT: Can you tell me how you got the tags for the frame? IE_Selector.exe isn't finding them for me (Win7 64-bit here).
To get iframes selectors, I used a recorded script from iMacros (use css checked in 'settings') and convert it in TagiE with the tool iMacros_TagIE_converter... :)
IE_selector doesn't give iframe selector...

@leosouza85:
Do you try it on other iframes?
It's just working with single level iframe for now... (not "multilevel", I need to implement the code to do it) :?
I can test only tomorrow at work... comobj do not work here in windows 10 for me (do you know a solution for this?)

On windows 10 it navigates to the webpage but it gives selector not found
burque505
Posts: 1242
Joined: 22 Jan 2017, 19:37

Re: [Editor] Browser Automation Macro Editor (TagIE)

03 Dec 2018, 14:50

Some preliminary (VERY preliminary) success in automating tag entry.
So far I've only done it for the tclick tag, and I need to add caret get/set routines to make sure the tags are placed correctly.
There is manual intervention necessary in the selection process, of course, but there's still too much.
For now, the user still has to move the selector info box, right-click the appropriate element, hit the "End" key to return control to IE, and close the info proggie manually.
Highlighting the element and pasting in the selector retrieved are automated, though.
Much work to do.
Code below is for tclick routine only.
Spoiler
Auto_2.gif
Auto_2.gif (179.72 KiB) Viewed 3469 times
Regards,
burque505
leosouza85
Posts: 39
Joined: 22 Jul 2016, 16:28

Re: [Editor] Browser Automation Macro Editor (TagIE)

04 Dec 2018, 14:43

adegard wrote:
03 Dec 2018, 05:59
@burque505:
EDIT: Can you tell me how you got the tags for the frame? IE_Selector.exe isn't finding them for me (Win7 64-bit here).
To get iframes selectors, I used a recorded script from iMacros (use css checked in 'settings') and convert it in TagiE with the tool iMacros_TagIE_converter... :)
IE_selector doesn't give iframe selector...

@leosouza85:
Do you try it on other iframes?
It's just working with single level iframe for now... (not "multilevel", I need to implement the code to do it) :?
Tested at work... did not work on the site that I sent you via PM

It didnt find the selector... but I think that site is multilevel frame, not sure.
User avatar
adegard
Posts: 87
Joined: 24 Nov 2017, 05:58
GitHub: adegard

Re: [Editor] Browser Automation Macro Editor (TagIE)

04 Dec 2018, 14:54

thanks @burque505, it's a good progress on recording way!
But I think that it could be easier to transcript IE selector in ahk directly.... (Now it's a autoit )

Then, after trascription, we could use it to this kind of sequence:
... when clicking on tag in IE, IE_selector send keys row "tclick("selector",0)" in TagUI Editor directly...
... when entering some text in IE, it send keys row "tenter("text", "selector, 0)" on Editor
and so on... Recording all the sequence automatically

What do you think about?

PS: I share the link of the source code of IE selector : https://www.autoitscript.com/forum/topi ... nt-1411942)
I didn't know how autoit works, but I think someone here know it!
User avatar
adegard
Posts: 87
Joined: 24 Nov 2017, 05:58
GitHub: adegard

Re: [Editor] Browser Automation Macro Editor (TagIE)

04 Dec 2018, 14:56

but I think that site is multilevel frame, not sure.
Yes, it's probably the case... Now we need to integrate the function with multilevel frames... :think:
leosouza85
Posts: 39
Joined: 22 Jul 2016, 16:28

Re: [Editor] Browser Automation Macro Editor (TagIE)

04 Dec 2018, 18:48

adegard wrote:
04 Dec 2018, 14:56
but I think that site is multilevel frame, not sure.
Yes, it's probably the case... Now we need to integrate the function with multilevel frames... :think:
The problem is that imacros code looks like it is only one frame so multilevel cannot be a direct translation :-o

maybe a loop frame [0][0], [0][1]... etc... then [1][0], [1][1] until the tag is found
burque505
Posts: 1242
Joined: 22 Jan 2017, 19:37

Re: [Editor] Browser Automation Macro Editor (TagIE)

04 Dec 2018, 20:34

@adegard, I agree with you 100% that the selector program should be in AutoHotkey. I haven't been able to port it yet - almost zero knowledge of AutoIt. Hopefully this weekend I'll get a chance to work on it.
Regards,
burque505
User avatar
adegard
Posts: 87
Joined: 24 Nov 2017, 05:58
GitHub: adegard

Re: [Editor] Browser Automation Macro Editor (TagIE)

06 Dec 2018, 09:55

New Release uploaded!

- TagIE Recorder (Beta) :D : Use new Recorder BUTTON and "Left-Click" in IE for normal navigation (based on IESelector, send functions to editor automatically : tenter() if type is text input, else tWaitAndClickSel() for clicks.

I modified Autoit script so ... Please try :!:
Limitations: it's not possibile for now to record text entering (then change tWaitAndClick by the tenter function); It doesn't work with iframes.
Image
Also:
- tWaitAndClickSel("sel", 0): new function which wait for selector and after click on this same selector.
- I fix the TagIE window Title ("TagIE") because of Handle control problem with autoit script
leosouza85
Posts: 39
Joined: 22 Jul 2016, 16:28

Re: [Editor] Browser Automation Macro Editor (TagIE)

09 Dec 2018, 13:26

adegard wrote:
06 Dec 2018, 09:55
New Release uploaded!

- TagIE Recorder (Beta) :D : Use new Recorder BUTTON and "Left-Click" in IE for normal navigation (based on IESelector, send functions to editor automatically : tenter() if type is text input, else tWaitAndClickSel() for clicks.

I modified Autoit script so ... Please try :!:
Limitations: it's not possibile for now to record text entering (then change tWaitAndClick by the tenter function); It doesn't work with iframes.
Image
Also:
- tWaitAndClickSel("sel", 0): new function which wait for selector and after click on this same selector.
- I fix the TagIE window Title ("TagIE") because of Handle control problem with autoit script
The way it is progressing it will be the tool of the future! Keep up the good work!
User avatar
adegard
Posts: 87
Joined: 24 Nov 2017, 05:58
GitHub: adegard

Re: [Editor] Browser Automation Macro Editor (TagIE)

09 Dec 2018, 14:39

Thanks you @leosouza85! ;-)
I'm just trying to simplify coding process, My coding knowledges are very low... I took already existing scripts , transforming a bit, and put it together... nothing new.

"future" need more: big data interpretations with IA, iOts devices connections... Far from this tool!

Return to “Scripts and Functions”

Who is online

Users browsing this forum: boiler, MTRNord, robodesign, Weshuggah and 66 guests