iMacros Form Filling for Auto Suggestion Dropdown - imacros
I am trying to fill up auto suggestion form on iMacros however despite all the efforts, it is still not working.
I tried
Method 1
The idea to work with Events
VERSION BUILD=9030808 RECORDER=FX
TAB T=1
URL GOTO=http://www.etihad.com/en-ae/
EVENT TYPE=CLICK XPATH="//input[#data-name='FlightBookingForm_Origin']"
BUTTON=0
EVENT TYPE=KEYPRESS XPATH="//input[#data-name='FlightBookingForm_Origin']"
CHAR="A"
EVENT TYPE=CLICK XPATH="//input[#data-name='FlightBookingForm_Origin']"
BUTTON=0
EVENT TYPE=KEYPRESS XPATH="//input[#data-name='FlightBookingForm_Origin']"
CHAR="U"
EVENT TYPE=CLICK XPATH="//input[#data-name='FlightBookingForm_Origin']"
BUTTON=0
EVENT TYPE=KEYPRESS XPATH="//input[#data-name='FlightBookingForm_Origin']"
CHAR="H"
EVENTS TYPE=KEYPRESS XPATH="//input[#data-name='FlightBookingForm_Origin']"
KEYS="[37,13]"
Method 2 Xpath Form Filling
VERSION BUILD=9030808 RECORDER=FX
TAB T=1
URL GOTO=http://www.etihad.com/en-ae/
EVENT TYPE=CLICK XPATH="//input[#data-name='FlightBookingForm_Origin']" BUTTON=0
WAIT SECONDS=5
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:wrapper ATTR=ID:frm_2012158061206151234
CONTENT=Abu<SP>Dhabi,<SP>Abu<SP>Dhabi<SP>Airport<SP>(AUH),
<SP>United<SP>Arab<SP>Emirates
TAG POS=1 TYPE=A ATTR=ID:ui-active-menuitem
WAIT SECONDS=5
EVENT TYPE=CLICK XPATH="//input[#data-name='FlightBookingForm_Destination']" BUTTON=0
WAIT SECONDS=5
TAG XPATH = "//input[#data-name='FlightBookingForm_Destination']"
CONTENT=London,<SP>Heathrow<SP>Airport<SP>(LHR),<SP>United<SP>Kingdom
WAIT SECONDS=5
TAG POS=1 TYPE=A ATTR=ID:ui-active-menuitem
WAIT SECONDS=5
The following way seems to work:
SET !REPLAYSPEED MEDIUM
EVENT TYPE=CLICK XPATH="//input[#data-name='FlightBookingForm_Origin']" BUTTON=0
EVENTS TYPE=KEYPRESS XPATH="//input[#data-name='FlightBookingForm_Origin']" CHARS="Abu Dhabi"
TAG XPATH="id('frm_2012158061206151234ui_autocomplete')/descendant::a"
EVENT TYPE=CLICK XPATH="//input[#data-name='FlightBookingForm_Destination']" BUTTON=0
EVENTS TYPE=KEYPRESS XPATH="//input[#data-name='FlightBookingForm_Destination']" CHARS="Heathrow"
TAG XPATH="id('frm_20121580612061235ui_autocomplete')/descendant::a"
Related
imacros select from popup dropdown
Could you please help me :) I have a TEXTBOX field which filling from a dropdown popup list. enter image description here It's not a drop-down list where I could use TYPE=SELECT It doesn't take it as just a text, it needs to be picking from the list. If I record a macro, it gives me: TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:management_main ATTR=ID:order_release/attribute1 CONTENT=201500 TAG POS=2 TYPE=TR ATTR=TXT:201500 If I record a macro in Experimental event recording mode: EVENT TYPE=CLICK SELECTOR="HTML>BODY>FORM>DIV:nth-of-type(3)>DIV>TABLE>TBODY>TR:nth-of-type(6)>TD:nth-of-type(3)>DIV>TABLE>TBODY>TR>TD>INPUT" BUTTON=0 EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY>FORM>DIV:nth-of-type(3)>DIV>TABLE>TBODY>TR:nth-of-type(6)>TD:nth-of-type(3)>DIV>TABLE>TBODY>TR>TD>INPUT" CHARS="201500" EVENT TYPE=KEYPRESS SELECTOR="HTML>BODY>FORM>DIV:nth-of-type(3)>DIV>TABLE>TBODY>TR:nth-of-type(6)>TD:nth-of-type(3)>DIV>TABLE>TBODY>TR>TD>INPUT" KEY=13 EVENT TYPE=CLICK SELECTOR="HTML>BODY>FORM>DIV:nth-of-type(4)>DIV>DIV>TABLE>TBODY>TR>TD>DIV>DIV>TABLE>TBODY>TR>TD" BUTTON=0 I've tried: EVENT TYPE=CLICK SELECTOR="#order_release/attribute1" BUTTON=0 EVENTS TYPE=KEYPRESS SELECTOR="#order_release/attribute1" CHARS="201500" it doesn't work also... Inspection of elements: enter image description here So still can't catch this event to fill that field... Have you any idea for me? I would be veeeeeery thankful) Thank you in advance!
I have found a solution and it works: TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:management_main ATTR=NAME:order_release/attribute1 CONTENT={{!COL7}} TAG POS=1 TYPE=INPUT:HIDDEN FORM=NAME:management_main ATTR=ID:order_release/attribute1#ID CONTENT={{!COL7}}
iMacros EVENT mode is malfunctioning during KEYPRESS
I have an iMacros code that copies content from one blog and posts the article image and article body content to my Facebook Wall post. Here is the working code: VERSION BUILD=844 RECORDER=CR SET !EXTRACT_TEST_POPUP NO SET URL http://www.marketwatch.com/story/too-early-to-tell-if-trump-bump-seen-in-jobs-numbers-economists-say-2017-03-10 URL GOTO={{URL}} WAIT SECONDS=2 TAG POS=1 TYPE=IMG ATTR=CLASS:article-image<SP>MG EXTRACT=HREF SET IMG {{!EXTRACT}} SET !EXTRACT NULL TAG POS=1 TYPE=DIV ATTR=ID:article-body EXTRACT=TXT SET BODY EVAL("var s=\"{{!EXTRACT}}\"; s=s.split('More from this Website')[0]; s;") SET !EXTRACT NULL URL GOTO=www.facebook.com WAIT SECONDS=2 TAG POS=1 TYPE=DIV ATTR=CLASS:composerAudienceWrapper<SP>stat_elem<SP>_ej0 WAIT SECONDS=2 EVENTS TYPE=KEYPRESS SELECTOR="DIV[CLASS='_1mf _1mj']" CHARS="{{IMG}}" WAIT SECONDS=5 EVENTS TYPE=KEYPRESS SELECTOR="DIV[CLASS='_1mf _1mj']" KEYS="[8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8]" WAIT SECONDS=2 EVENTS TYPE=KEYPRESS SELECTOR="DIV[CLASS='_1mf _1mj']" CHARS="{{BODY}}" TAG POS=1 TYPE=BUTTON FORM=ID:u_0_15 ATTR=TXT:Post WAIT SECONDS=2 At this line: EVENTS TYPE=KEYPRESS SELECTOR="DIV[CLASS='_1mf _1mj']" CHARS="{{IMG}}" , when the code pastes the image URL into Facebook, it does the work halfway and it starts to mis-function - meaning it starts clicking some randone buttons on my facebook wall (while this line of code is still executing)... Is there a solution to this issue?
If you want to paste a large piece of text, try to do this via clipboard, for example: SET !EXTRACT_TEST_POPUP NO SET URL http://www.marketwatch.com/story/too-early-to-tell-if-trump-bump-seen-in-jobs-numbers-economists-say-2017-03-10 URL GOTO={{URL}} WAIT SECONDS=2 TAG POS=1 TYPE=IMG ATTR=CLASS:article-image<SP>MG EXTRACT=HREF SET IMG {{!EXTRACT}} SET !EXTRACT NULL TAG POS=1 TYPE=DIV ATTR=ID:article-body EXTRACT=TXT SET BODY EVAL("var s=\"{{!EXTRACT}}\"; s=s.split('More from this Website')[0]; s;") SET !EXTRACT NULL URL GOTO=www.facebook.com WAIT SECONDS=2 SET !CLIPBOARD {{IMG}} TAG POS=1 TYPE=LABEL ATTR=TXT:"Choose a file to upload" TAG POS=R1 TYPE=DIV ATTR=ID:* EXTRACT=HTM SET id EVAL("'{{!EXTRACT}}'.match(/id="(.*?)"/)[1];") EVENT TYPE=CLICK SELECTOR="#{{id}}>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV" BUTTON=0 EVENT TYPE=KEYPRESS SELECTOR="#{{id}}>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>DIV" CHAR="v" MODIFIERS="ctrl" ' ...
unable to make a facebook post using iMacros
I made a script on iMacros using normal recording mode to make a wall post, but it doesn't seem to be recording the content to pasted on my wall though.. This is the code I wrote using the normal mode TAG POS=1 TYPE=DIV ATTR=CLASS:_1mf<SP>_1mj EXTRACT=TXT The above is able to extract contents from the post message field, however I'm unable to make it type contents into the same field... :( Now, I have tried using EVENT recording mode and I am still facing issues.. Here is my code: EVENT TYPE=MOUSEDOWN SELECTOR="#u_0_16" BUTTON=0 EVENT TYPE=MOUSEUP POINT="(386,118)" EVENT TYPE=KEYPRESS SELECTOR="#js_gy>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>DIV" CHAR="d" EVENTS TYPE=KEYPRESS SELECTOR="#js_gy>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV>DIV" CHARS="Pasting Sample Content" What am i doing wrong? :O :O
I don't know why you're still facing issues. So for example, try to play these lines: TAG POS=1 TYPE=DIV ATTR=CLASS:_1mf<SP>_1mj EXTRACT=TXT EVENT TYPE=CLICK SELECTOR="DIV[CLASS='_1mf _1mj']" BUTTON=0 EVENTS TYPE=KEYPRESS SELECTOR="DIV[CLASS='_1mf _1mj']" CHARS={{!EXTRACT}}
iMacro issue posting to minds. com
The new social media site minds.com does not seem to have an API for posting, so I have tried to create a macro to do so from a single line text file, thus (iMacros for Firefox [50.1]). I have tried the x-y method and the conventional methods as well as the "experimental" mode, shown following: VERSION BUILD=9030808 RECORDER=FX TAB T=1 'SET !ERRORIGNORE YES SET !DATASOURCE C:\[path-to-file]\[single line of text here].txt SET !DATASOURCE_COLUMNS 1 SET !LOOP 1 'SET !DATASOURCE_LINE {{!LOOP}} 'SET !DATASOURCE_LINE {{1}} URL GOTO=https://www.minds.com/newsfeed EVENT TYPE=CLICK SELECTOR="HTML>BODY>MINDS-APP>MINDS-BODY>MINDS- NEWSFEED>DIV>DIV>MINDS-NEWSFEED-POSTER>DIV>DIV>FORM>TEXTAREA" BUTTON=0 EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY>MINDS-APP>MINDS-BODY>MINDS- NEWSFEED>DIV>DIV>MINDS-NEWSFEED-POSTER>DIV>DIV>FORM>TEXTAREA" CONTENT=Hi! EVENT TYPE=CLICK SELECTOR="HTML>BODY>MINDS-APP>MINDS-BODY>MINDS- NEWSFEED>DIV>DIV>MINDS-NEWSFEED-POSTER>DIV>DIV>FORM>DIV>BUTTON" BUTTON=0 and I tried: VERSION BUILD=9030808 RECORDER=FX TAB T=1 URL GOTO=https://www.minds.com/newsfeed SET !TIMEOUT_PAGE 30 TAG POS=1 TYPE=TEXTAREA FORM=NAME:NoFormName ATTR=ID:message CONTENT=Hello! TAG POS=1 TYPE=BUTTON FORM=NAME:NoFormName ATTR=ID:Post<SP>send Neither seems to work, nor does an x-y click (which just highlights the 'Post' button but does not "click" it). The salient HTML for the button is: <button class="mdl-button mdl-button--colored" type="submit"> Post <i class="material-icons">send</i> </button> I'm not sure what I'm missing. Any suggestions would be greatly appreciated. Thanks! -Brian Brown, Ph.D.
This part of your macro must work fine: EVENT TYPE=CLICK SELECTOR="HTML>BODY>MINDS-APP>MINDS-BODY>MINDS-NEWSFEED>DIV>DIV>MINDS-NEWSFEED-POSTER>DIV>DIV>FORM>TEXTAREA" BUTTON=0 EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY>MINDS-APP>MINDS-BODY>MINDS-NEWSFEED>DIV>DIV>MINDS-NEWSFEED-POSTER>DIV>DIV>FORM>TEXTAREA" CHARS="Hi !" EVENT TYPE=CLICK SELECTOR="HTML>BODY>MINDS-APP>MINDS-BODY>MINDS-NEWSFEED>DIV>DIV>MINDS-NEWSFEED-POSTER>DIV>DIV>FORM>DIV>BUTTON" BUTTON=0 Doesn't it?
Cannot Click on the button with Imacros
I cannot find a way to click on the button on Google Drive to click "File upload" in Inspect element cannot find the exactly class which is changing every time, trued to record with all kind of style but still not working. Would be great if some one can check and figure out how it can be clicked. Thank You in advance. URL GOTO=https://drive.google.com/drive/my-drive EVENT TYPE=MOUSEDOWN SELECTOR="#drive_main_page>DIV:nth-of-type(4)>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV>DIV>DIV" BUTTON=0 TAG POS=2 TYPE=DIV ATTR=CLASS:*-v&&ROLE:menuitem&&ID::4b TAG POS=1 TYPE=INPUT:FILE ATTR=* CONTENT=C:\Users\Viktor\Documents\iMacros\Downloads\Folder\1.png
The following solution seems to work somehow: ' text for English as default language ' SET txtUpload "Upload files..." URL GOTO=https://drive.google.com/drive/my-drive EVENT TYPE=CLICK SELECTOR="#drive_main_page>DIV:nth-of-type(4)>DIV>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>svg>polygon" BUTTON=0 WAIT SECONDS=0.5 SET !EXTRACT_TEST_POPUP NO TAG POS=1 TYPE=DIV ATTR=TXT:{{txtUpload}} EXTRACT=HTM SET id EVAL("'{{!EXTRACT}}'.match(/id=\"(.+?)\"/)[1];") EVENT TYPE=CLICK SELECTOR="#\\{{id}}>DIV>SPAN:nth-of-type(2)>SPAN>DIV" BUTTON=0 TAG POS=1 TYPE=INPUT:FILE ATTR=* CONTENT=C:\Users\Viktor\Documents\iMacros\Downloads\Folder\1.png