Problem with "SELECT" (Drop Down List)

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
Igor

Problem with "SELECT" (Drop Down List)

Post by Igor » Sun Oct 16, 2005 9:31 am

Say we have a select in the html:
<SELECT>
<OPTION>Some Option</OPTION>
<OPTION>Today News</OPTION>
<OPTION>Some Option</OPTION>
<OPTION>Today Weather</OPTION>
</SELECT>

I want to build a macro that will click on all options that have a word "Today" in it (skipping all other options). The position of these options is dynamic so i tried the following:

TAG POS=1 TYPE=SELECT FORM=NAME:frm1 ATTR=NAME:top_menu CONTENT=$*Today*

this command worked for the first option that had "Today" but if the next line is:

TAG POS=2 TYPE=SELECT FORM=NAME:frm1 ATTR=NAME:top_menu CONTENT=$*Today*

this command does not work. It seems that its searching for the next "SELECT" but not next option inside the "SELECT".

How can i overcome this problem?
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Post by Tech Support » Sun Oct 16, 2005 10:47 pm

The POS attribute describes the position of the SELECT element.

TAG POS=2 TYPE=SELECT FORM=NAME:frm1 ATTR=NAME:top_menu CONTENT=$*Today*

This means the second select element with the name "top_menu" (which does not exist). It does not mean the second entry in the first select element.

Before I can suggest a workaround I need to know:

Do you want to select all "Today.." entries at once (multiple select) or one "today.." after the other (e. g. within a loop)?
Igor

Post by Igor » Mon Oct 17, 2005 6:38 am

I want to select one "Today" after another, and without a loop - the loop is not needed in this case because i know the maximum number of options with "Today" in it - its 5. So i want 5 commands one after another so that each of them selects next option with "Today".
Post Reply