Change HTML

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.

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.

Change HTML

by Feixinator on Sun Feb 12, 2017 5:21 am

I need to change with a macro this:

Code: Select all
<input id="submitBtn" value="Send"  type="submit">


into this

Code: Select all
<input id="submitBtn" disabled="" value="Send"  type="submit">


So just remove the disabled="" attribute!

How to get this?
Feixinator
 
Posts: 1
Joined: Sun Feb 12, 2017 5:18 am

Re: Change HTML

by serbeer on Mon Feb 13, 2017 1:09 pm

iMacros would not do it, you have to use Greasemonkey instead
serbeer
 
Posts: 35
Joined: Thu Sep 10, 2015 10:36 pm

Re: Change HTML

by iimfun on Tue Feb 14, 2017 1:31 am

Why not iMacros?

Set "disabled"
Code: Select all
URL GOTO=javascript:document.querySelector("#submitBtn").setAttribute("disabled","");

Remove "disabled"
Code: Select all
URL GOTO=javascript:document.querySelector("#submitBtn").removeAttribute("disabled");
iimfun
 
Posts: 225
Joined: Tue Jul 19, 2016 6:06 am

Re: Change HTML

by matteo_tumi on Thu May 11, 2017 7:51 am

Hi,

I also need change html with imacros. But I can not recall functions with url goto..

Start html code:
Code: Select all
<INPUT onclick=AT.ATHandleAction(7)
tabIndex=1008
onkeypress=AT.ACTKeyPress(event)
disabled
id=Action7
class=clsActionButtonDisabled
type=button value=Conferma oldStyle="undefined">

I would like to remove the disabled attribute and edit the class, so:
Code: Select all
<INPUT onclick=AT.ATHandleAction(7)
tabIndex=1008
onkeypress=AT.ACTKeyPress(event)
id=Action7
class=clsActionButtonEnabled
type=button value=Conferma oldStyle="undefined">

but, this code:
Code: Select all
URL GOTO=javascript:document.querySelector("#Action7").removeClass("clsActionButtonDisabled");
URL GOTO=javascript:document.querySelector("#Action7").addClass("clsActionButtonEnabled");
URL GOTO=javascript:document.querySelector("#Action7").removeAttr("disabled");
TAG POS=1 TYPE=INPUT:BUTTON ATTR=ID:Action7

does not work :(

please, help meee
matteo_tumi
 
Posts: 2
Joined: Thu May 11, 2017 7:41 am

Re: Change HTML

by chivracq on Thu May 11, 2017 11:09 am

matteo_tumi wrote:Hi,

I also need change html with imacros. But I can not recall functions with url goto..

Start html code:
Code: Select all
<INPUT onclick=AT.ATHandleAction(7)
tabIndex=1008
onkeypress=AT.ACTKeyPress(event)
disabled
id=Action7
class=clsActionButtonDisabled
type=button value=Conferma oldStyle="undefined">

I would like to remove the disabled attribute and edit the class, so:
Code: Select all
<INPUT onclick=AT.ATHandleAction(7)
tabIndex=1008
onkeypress=AT.ACTKeyPress(event)
id=Action7
class=clsActionButtonEnabled
type=button value=Conferma oldStyle="undefined">

but, this code:
Code: Select all
URL GOTO=javascript:document.querySelector("#Action7").removeClass("clsActionButtonDisabled");
URL GOTO=javascript:document.querySelector("#Action7").addClass("clsActionButtonEnabled");
URL GOTO=javascript:document.querySelector("#Action7").removeAttr("disabled");
TAG POS=1 TYPE=INPUT:BUTTON ATTR=ID:Action7

does not work :(

please, help meee

FCIM...! :mrgreen:
Always mention your FCI (read my Sig) when you open a Thread or post for the first time in some existing Thread, many Commands are not implemented for all Browsers/Versions...

"does not work" is always a bit vague...! Do you get any RuntimeError...?

Solution/Explanation to your Pb depends probably on your FCI, + your 'removeClass()' / 'addClass()' / 'removeAttr()' Functions are no Native JavaScript Functions but jQuery Functions, and iMacros doesn't know anything about jQuery...
- (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: 6277
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Change HTML

by matteo_tumi on Fri May 12, 2017 5:41 am

chivracq wrote:FCIM...! :mrgreen:
Always mention your FCI (read my Sig) when you open a Thread or post for the first time in some existing Thread, many Commands are not implemented for all Browsers/Versions...

Ops .. sorry!

chivracq wrote:"does not work" is always a bit vague...! Do you get any RuntimeError...?

However, it does not re-run any Runtime Error! :?

chivracq wrote:Solution/Explanation to your Pb depends probably on your FCI, + your 'removeClass()' / 'addClass()' / 'removeAttr()' Functions are no Native JavaScript Functions but jQuery Functions, and iMacros doesn't know anything about jQuery...

I've just seen today that those are unsupported features. In fact, using:
Code: Select all
URL GOTO = javascript: frames ['ApplicationFrame']. Document.getElementById ('Action7'). SetAttribute ('disabled', false);

it works!

The problem now is that (I do not know why) only works in "Record" mode (script creation from iMacros)... and not in Running mode .iim :(
matteo_tumi
 
Posts: 2
Joined: Thu May 11, 2017 7:41 am

Re: Change HTML

by chivracq on Fri May 12, 2017 9:38 am

matteo_tumi wrote:
chivracq wrote:FCIM...! :mrgreen:
Always mention your FCI (read my Sig) when you open a Thread or post for the first time in some existing Thread, many Commands are not implemented for all Browsers/Versions...

Ops .. sorry!

Yeah..., and what is your FCI...!? :roll:

matteo_tumi wrote:
chivracq wrote:"does not work" is always a bit vague...! Do you get any RuntimeError...?

However, it does not re-run any Runtime Error! :?

Okay..., hum, I would have some follow-up-Qt, but depends on your FCI which you still haven't mentioned, so never mind...

matteo_tumi wrote:
chivracq wrote:Solution/Explanation to your Pb depends probably on your FCI, + your 'removeClass()' / 'addClass()' / 'removeAttr()' Functions are no Native JavaScript Functions but jQuery Functions, and iMacros doesn't know anything about jQuery...

I've just seen today that those are unsupported features. In fact, using:
Code: Select all
URL GOTO = javascript: frames ['ApplicationFrame']. Document.getElementById ('Action7'). SetAttribute ('disabled', false);

it works!

The problem now is that (I do not know why) only works in "Record" mode (script creation from iMacros)... and not in Running mode .iim :(

Yeah but sorry, "CIM" again for me to follow up... :roll:
I will only say that you are in the right Direction with your last 'URL GOTO' Statement... But I won't reply anymore if mentioning 3 Versions about your precise Config/Environment is too complicated... :idea:
- (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: 6277
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to General Support & Discussions

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], Google [Bot] and 4 guests

-->