In my current project I have to read a JavaScript file from the web and extract an object from it. The variable can vary from time to time, so I have to read it instead of h
There are many libraries in Java to parse the JSON. There is a list on JSON.org
Read the file with Java
import org.json.JSONObject; URL url = new URL("http://example.com/foo.js"); InputStream urlInputStream = url.openStream(); JSONObject json = new JSONObject(urlInputStream.toString());