Re: [Editor] Browser Automation Macro Editor (TagIE)
Posted: 01 Dec 2018, 09:55
Yes it is possible maybe a function to autoconnect to the frame in ahk
Let's help each other out
https://www.autohotkey.com/boards/
Yes it is possible maybe a function to autoconnect to the frame in ahk
@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
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
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
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
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)
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
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).
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)
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)
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.
The problem is that imacros code looks like it is only one frame so multilevel cannot be a direct translation
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