If we want interaction out of the box with the web page we are surfing, we must use tool such as GreaseMonkey and write our UserScripts that allow us to change page behavior to our desired one. This still needs us to open browser window and visit our target.
./clibrowser http://google.com userscript.js
In which script, for example, we could run some AJAX code to fetch data coming from queries and pass it to some other PHP script that's save it to database.
There is also Rhino, which runs on Java: http://www.mozilla.org/rhino/.
©2020 All rights reserved.