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.
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
Feixinator
Posts: 1
Joined: Sun Feb 12, 2017 12:18 pm

Change HTML

Post by Feixinator » Sun Feb 12, 2017 12:21 pm

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?
serbeer
Posts: 44
Joined: Fri Sep 11, 2015 5:36 am

Re: Change HTML

Post by serbeer » Mon Feb 13, 2017 8:09 pm

iMacros would not do it, you have to use Greasemonkey instead
iimfun
Posts: 239
Joined: Tue Jul 19, 2016 1:06 pm

Re: Change HTML

Post by iimfun » Tue Feb 14, 2017 8: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");
matteo_tumi
Posts: 2
Joined: Thu May 11, 2017 2:41 pm

Re: Change HTML

Post by matteo_tumi » Thu May 11, 2017 2:51 pm

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
chivracq
Posts: 8716
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Change HTML

Post by chivracq » Thu May 11, 2017 6:09 pm

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)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
matteo_tumi
Posts: 2
Joined: Thu May 11, 2017 2:41 pm

Re: Change HTML

Post by matteo_tumi » Fri May 12, 2017 12:41 pm

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 :(
chivracq
Posts: 8716
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Change HTML

Post by chivracq » Fri May 12, 2017 4:38 pm

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)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Post Reply