Yes it is possible maybe a function to autoconnect to the frame in ahk
[Editor] Browser Automation Macro Editor (TagIE)
-
- Posts: 90
- Joined: 22 Jul 2016, 16:28
Re: [Editor] Browser Automation Macro Editor (TagIE)
Re: [Editor] Browser Automation Macro Editor (TagIE)
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.
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.
- Attachments
-
- IE_Selector_2018.zip
- (1.24 MiB) Downloaded 195 times
Re: [Editor] Browser Automation Macro Editor (TagIE)
@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!
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!
Re: [Editor] Browser Automation Macro Editor (TagIE)
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!
- 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!
Re: [Editor] Browser Automation Macro Editor (TagIE)
@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:leosouza85 wrote: ↑30 Nov 2018, 15:06Wonderful work!!! Really hope that someday it will work with frames and multilevel frames
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)"
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
-
- Posts: 90
- Joined: 22 Jul 2016, 16:28
Re: [Editor] Browser Automation Macro Editor (TagIE)
fantastic! thank you so much!adegard wrote: ↑02 Dec 2018, 12:25@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:leosouza85 wrote: ↑30 Nov 2018, 15:06Wonderful work!!! Really hope that someday it will work with frames and multilevel frames
iMacros code:TagIE/Autohotkey that works is: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)"
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
Re: [Editor] Browser Automation Macro Editor (TagIE)
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:
Now I need to update all examples!
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
Re: [Editor] Browser Automation Macro Editor (TagIE)
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.
and
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
Code: Select all
#actionbar>UL>LI:nth-of-type(2)>DIV>DIV>SPAN>SPAN:nth-of-type(2)
-
- Posts: 90
- Joined: 22 Jul 2016, 16:28
Re: [Editor] Browser Automation Macro Editor (TagIE)
thankyou so much!adegard wrote: ↑02 Dec 2018, 13:30Your 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:Now I need to update all examples!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
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
Re: [Editor] Browser Automation Macro Editor (TagIE)
@burque505:
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)
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...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).
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)
-
- Posts: 90
- Joined: 22 Jul 2016, 16:28
Re: [Editor] Browser Automation Macro Editor (TagIE)
I can test only tomorrow at work... comobj do not work here in windows 10 for me (do you know a solution for this?)adegard wrote: ↑03 Dec 2018, 05:59@burque505: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...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).
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)
On windows 10 it navigates to the webpage but it gives selector not found
Re: [Editor] Browser Automation Macro Editor (TagIE)
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.
burque505
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
Regards,burque505
-
- Posts: 90
- Joined: 22 Jul 2016, 16:28
Re: [Editor] Browser Automation Macro Editor (TagIE)
Tested at work... did not work on the site that I sent you via PMadegard wrote: ↑03 Dec 2018, 05:59@burque505: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...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).
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)
It didnt find the selector... but I think that site is multilevel frame, not sure.
Re: [Editor] Browser Automation Macro Editor (TagIE)
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!
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!
Re: [Editor] Browser Automation Macro Editor (TagIE)
Yes, it's probably the case... Now we need to integrate the function with multilevel frames...but I think that site is multilevel frame, not sure.
-
- Posts: 90
- Joined: 22 Jul 2016, 16:28
Re: [Editor] Browser Automation Macro Editor (TagIE)
The problem is that imacros code looks like it is only one frame so multilevel cannot be a direct translation
maybe a loop frame [0][0], [0][1]... etc... then [1][0], [1][1] until the tag is found
Re: [Editor] Browser Automation Macro Editor (TagIE)
@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
Regards,
burque505
Re: [Editor] Browser Automation Macro Editor (TagIE)
New Release uploaded!
- TagIE Recorder (Beta) : 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.
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
- TagIE Recorder (Beta) : 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.
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
-
- Posts: 90
- Joined: 22 Jul 2016, 16:28
Re: [Editor] Browser Automation Macro Editor (TagIE)
The way it is progressing it will be the tool of the future! Keep up the good work!adegard wrote: ↑06 Dec 2018, 09:55New Release uploaded!
- TagIE Recorder (Beta) : 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.
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
Re: [Editor] Browser Automation Macro Editor (TagIE)
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!
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 (v1)”
Who is online
Users browsing this forum: No registered users and 42 guests