How To Execute Javascript On A Webpage Using Java
I am establishing a HttpUrlConnection with a webpage . Now I have javascript snippet that I want to execute on this webpage . How can I do this ?
Solution 1:
You could try :
private static ScriptEngineManager mgr = null;
private static ScriptEngine engine = null;
mgr = new ScriptEngineManager();
engine = mgr.getEngineByName("JavaScript");
Object eval = engine.eval(s); // s is javascript code
Post a Comment for "How To Execute Javascript On A Webpage Using Java"