I am trying to automate a website. The Javascript is executing perfectly in the browser console but not in the python console. When executing the script, it runs but nothing happens. I tried implicit waits and everything, below is the Javascript I use inside Python:
Browser.execute_script("""!function(e){
"use strict";var t,r=[],n=e.document,o=e.MutationObserver||e.WebKitMutationObserver;function c(){
for(var e,t,o=0,c=r.length;o<c;o++){
e=r[o];
for(var l,s=0,u=(t=n.querySelectorAll(e.selector)).length;s<u;s++)(l=t[s]).ready||(l.ready=!0,e.fn.call(l,l))
}
}
e.ready=function(e,l){
r.push({selector:e,fn:l}),t||(t=new o(c)).observe(n.documentElement,{
childList:!0,subtree:!0
}),c()
}
}(this);
ready("#split-btn > div > div > div.col.text-right.ng-tns-c73-0 > div > div > div > button:nth-child(8)", function(){this.click();})""")