1

I'm looking for a command line browser or web browser command-line interface (headless/gui-less option) that can be run in a terminal (preferably linux/bash) which loads the DOM and received javascript, and then allows for console execution of javascript on the loaded DOM. The goal is to operate on the DOM through the console.

I'm not looking for CLI-based page downloading, stand-alone js execution or load a js page from CLI. Links and Lynx both explicitly do not support javascript (at least according to those wikipedia pages).

Are there any command-line-based or very-very-lightweight we browsers that I could use [preferably through linux/bash (Ubuntu/Mac OS X)] to operate on the browser DOM with javascript support using an interactive console or locally-sourced javascript code?

user3.1415927
  • 331
  • 3
  • 18
  • Could you append a ` – Ben West Jul 01 '18 at 18:36
  • @BenWest Hmm, that’s not a bad idea, although I’m not sure how I would do that in such a way that it would auto-execute on load completion and run the JavaScript automation I’m trying to execute. Can you write an answer with a proof of concept or demonstration? I suppose I could use burp suite to modify the page as it returns to the browser, but I do not know exactly how to do that, nor do I know how to trigger the JavaScript automation I’ve been running by pasting it into the terminal after the DOM loads in the browser. – user3.1415927 Jul 02 '18 at 04:12
  • I'm not familiar with any headless browsers so couldn't write an example, just pointing out that placing code in a script tag and entering it in the browser console should be equivalent. To defer until after load you should be able to use the standard load event just like you were in a browser. – Ben West Jul 03 '18 at 10:03

0 Answers0