How to use iMacros to add HTML tag values in new line or Edit existing tag

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

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
birdchew
Posts: 12
Joined: Sun Aug 28, 2022 2:37 pm

How to use iMacros to add HTML tag values in new line or Edit existing tag

Post by birdchew » Thu Sep 29, 2022 1:06 pm

Google Chrome: Version 105.0.5195.102 (Official Build) (64-bit)
iMacros: 2021
System: Windows 10 Pro 21H2 19044.1949

There's a dropdown selection box with multiple preset tag values for user selection. However, I need a tag value with my own range value="30.0 To 70.0">30.0 To 70.0 which is not available.

How can I add a new tag value (new line) OR edit the existing to modify my required range by using iMacros Browser.

I've read a few similar post & solutions by Guru Shugar but those are for adding "value" into an empty field and another is to remove attribute "disabled" which is not what i required.

Any help will be much appreciated. Thanks.

Code: Select all

	<p>Score PT</p>
			</p>
                           <select name="ExpScorePT">
                                <option class="_def" value="-Any-">-Any-</option>
                                <option value="Above 5.0">Above 5.0</option>
                                <option value="Above 10.0">Above 10.0</option>
                                <option value="Above 20.0">Above 20.0</option>
                                <option value="Above 30.0">Above 30.0</option>
                                <option value="Above 50.0">Above 50.0</option>
                                <option value="Above 70.0">Above 70.0</option>
                                <option value="Above 90.0">Above 90.0</option>
                                <option value="Above 120.0">Above 120.0</option>
                                <option value="5.0 To 20.0">5.0 To 20.0</option>
                                <option value="20.0 To 50.0">20.0 To 50.0</option>
                                <option value="50.0 To 100.0">50.0 To 100.0</option>
                                <option value="Below 5.0">Below 5.0</option>
                                <option value="Below 10.0">Below 10.0</option>
                                <option value="Below 20.0">Below 20.0</option>
                                <option value="Below 50.0">Below 50.0</option>
                                <option value="Below 70.0">Below 70.0</option>
                                <option value="Below 90.0">Below 90.0</option>
                                <option value="Below 120.0">Below 120.0</option>
                        </select>
                    </p>  
birdchew
Posts: 12
Joined: Sun Aug 28, 2022 2:37 pm

Re: How to use iMacros to add HTML tag values in new line or Edit existing tag

Post by birdchew » Thu Sep 29, 2022 1:41 pm

birdchew wrote:
Thu Sep 29, 2022 1:06 pm
Google Chrome: Version 105.0.5195.102 (Official Build) (64-bit)
iMacros: 2021
System: Windows 10 Pro 21H2 19044.1949

There's a dropdown selection box with multiple preset tag values for user selection. However, I need a tag value with my own range value="30.0 To 70.0">30.0 To 70.0 which is not available.

How can I add a new tag value (new line) OR edit the existing to modify my required range by using iMacros Browser.

I've read a few similar post & solutions by Guru Shugar but those are for adding "value" into an empty field and another is to remove attribute "disabled" which is not what i required.

Any help will be much appreciated. Thanks.

Code: Select all

	<p>Score PT</p>
			</p>
                           <select name="ExpScorePT">
                                <option class="_def" value="-Any-">-Any-</option>
                                <option value="Above 5.0">Above 5.0</option>
                                <option value="Above 10.0">Above 10.0</option>
                                <option value="Above 20.0">Above 20.0</option>
                                <option value="Above 30.0">Above 30.0</option>
                                <option value="Above 50.0">Above 50.0</option>
                                <option value="Above 70.0">Above 70.0</option>
                                <option value="Above 90.0">Above 90.0</option>
                                <option value="Above 120.0">Above 120.0</option>
                                <option value="5.0 To 20.0">5.0 To 20.0</option>
                                <option value="20.0 To 50.0">20.0 To 50.0</option>
                                <option value="50.0 To 100.0">50.0 To 100.0</option>
                                <option value="Below 5.0">Below 5.0</option>
                                <option value="Below 10.0">Below 10.0</option>
                                <option value="Below 20.0">Below 20.0</option>
                                <option value="Below 50.0">Below 50.0</option>
                                <option value="Below 70.0">Below 70.0</option>
                                <option value="Below 90.0">Below 90.0</option>
                                <option value="Below 120.0">Below 120.0</option>
                        </select>
                    </p>  
I've tried the following but it's not working :-

To Add new line tag values :-

Code: Select all

URL GOTO=javascript:{document.querySelector("#ExpScorePT").addAttribute("30.0 To 70.0");}
   
URL GOTO=javascript:{document.querySelector("#name:ExpScorePT").addAttribute("30.0 To 70.0");}
   
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:ExpScorePT CONTENT=%"30.0<SP>To<SP>70.0" 
techimac
Posts: 482
Joined: Fri Feb 20, 2015 9:27 pm

Re: How to use iMacros to add HTML tag values in new line or Edit existing tag

Post by techimac » Tue Oct 04, 2022 8:27 pm

Code: Select all

const node = document.createElement("option");
const textnode = document.createTextNode("30.0 To 70.0");
node.appendChild(textnode);
document.querySelector("select").appendChild(node);
Available for custom iim, javascript iMacros scripts
Post Reply