CSY LOOP EXTRACT-element INPUT specified by ID error message

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

CSY LOOP EXTRACT-element INPUT specified by ID error message

by elif90 on Thu Oct 19, 2017 2:01 am

Hello everyone!!
I am brand new to imacros- so my question might sound trivial, however I am stuck with it.

I am trying to running the following macro that extract the coordinates from a list of postcodes and put them in a new file.

This is the macro:
VERSION BUILD=9030808 RECORDER=FX

TAB T=1
SET !DATASOURCE postcode_sec.csv

SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
SET !DATASOURCE_COLUMNS 2

URL GOTO=http://www.latlong.net/
WAIT SECONDS = 2

TAG POS=1 TYPE=INPUT:TEXT FORM=ID:latlongform ATTR=ID:mt3201 CONTENT={{!COL1}}
TAG POS=1 TYPE=BUTTON:find FORM=ID:latlongform ATTR=TXT:Find

WAIT SECONDS = 2
ADD !EXTRACT <{{postcode}}>
ADD !EXTRACT {{!COL1}}
TAG POS=1 TYPE=SPAN ATTR=ID:latlngspan EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=* FILE=latlong_postcode_sec.txt

It always gives me the following error message, no matter the ID that i put:

element INPUT specified by ID:mt3201 was not found, line: 15 (Error code: -921)

This is the HTML code for the INPUT TEXT:

<input id="rQ2924" placeholder="Type a place name" class="width70" required="" type="text">


Could someone help me?? I am totally stuck and I don't understand why!
Many many thanks in advance!!
elif90
 
Posts: 1
Joined: Thu Oct 19, 2017 1:44 am

Re: CSY LOOP EXTRACT-element INPUT specified by ID error mes

by chivracq on Thu Oct 19, 2017 10:22 am

elif90 wrote:Hello everyone!!
I am brand new to imacros- so my question might sound trivial, however I am stuck with it.

I am trying to running the following macro that extract the coordinates from a list of postcodes and put them in a new file.

This is the macro:
Code: Select all
VERSION BUILD=9030808 RECORDER=FX

TAB T=1
SET !DATASOURCE postcode_sec.csv

SET !LOOP 2
SET !DATASOURCE_LINE  {{!LOOP}}
SET !DATASOURCE_COLUMNS 2
 
URL GOTO=http://www.latlong.net/
WAIT SECONDS = 2

TAG POS=1 TYPE=INPUT:TEXT FORM=ID:latlongform ATTR=ID:mt3201 CONTENT={{!COL1}}
TAG POS=1 TYPE=BUTTON:find FORM=ID:latlongform ATTR=TXT:Find

WAIT SECONDS = 2
ADD !EXTRACT <{{postcode}}>
ADD !EXTRACT {{!COL1}}
TAG POS=1 TYPE=SPAN ATTR=ID:latlngspan EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=* FILE=latlong_postcode_sec.txt


It always gives me the following error message, no matter the ID that i put:
Code: Select all
element INPUT specified by ID:mt3201 was not found, line: 15 (Error code: -921)


This is the HTML code for the INPUT TEXT:
Code: Select all
<input id="rQ2924" placeholder="Type a place name" class="width70" required="" type="text">


Could someone help me?? I am totally stuck and I don't understand why!
Many many thanks in advance!!

FCIM...! :mrgreen: (Read my Sig...)
=> iMacros for FF v9.0.3, FF55/56...?, OS...?

Hum..., and try to select the correct Sub-Forum when you open a Thread, your Thread has very probably nothing specific to iMacros for FF only...

But yep, your Pb comes very probably from the ID for your 'INPUT' Field being dynamic, which is confirmed by "ID:mt3201" when you first recorded your Macro and becoming later "id="rQ2924"" in the mini-Source Excerpt you post.
=> You need to replace the "changing part" (which seems to be the whole ID in your Case) with a Wildcard (*) like:
Code: Select all
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:latlongform ATTR=ID:* CONTENT={{!COL1}}

You may need to adapt the 'POS=1' to 'POS=2' 'POS=3' etc if there are several 'INPUT' Fields on the Page, or to include the 'CLASS' as extra Attribute (even if that might not be "enough" as "class="width70"" doesn't sound very "unique" to me...).... and/or to include Relative Positioning to make sure to uniquely locate that 'INPUT' Field (and to try to keep the 'POS' Number as low as possible...).

Euh..., I didn't understand the "CSY" Term in your Thread Title btw, care to explain what this Acronym stands for...?
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6477
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to iMacros for Firefox

Who is online

Users browsing this forum: No registered users and 9 guests

-->