X
Tap here to go to the mobile version of the site.

Support Forum

"save as" text file from command line

Posted

Is it possible to do the equivalent of "save as" "text files" from the command line? Perhaps via an add-on? I've searched add-ons, this forum, etc., without success.

This comes up primarily because sometimes web pages nowadays do everything with JavaScript. Therefore lynx and its relatives can do nothing meaningful. It would be nice to be able to grab the content in batch from the command line, e.g., to check for updates from a cron job.

One example of such a page is the one for a musician I like: http://www.anaismitchell.com. Looking at the source shows only JS code, as far as my eyes can find. Firefox renders it just fine interactively, and if I do "save as" -> "text files", the result is perfectly decent. My goal is to do simply that from the command line.

A more technical example is the ISO country code search page:

 https://www.iso.org/obp/ui/#search

Pressing the search button there (with the empty string) brings up the country codes and other info, "save as" -> "text files" works fine, but view source and lynx can do nothing.

Help? Thanks in advance ...

Is it possible to do the equivalent of "save as" "text files" from the command line? Perhaps via an add-on? I've searched add-ons, this forum, etc., without success. This comes up primarily because sometimes web pages nowadays do everything with JavaScript. Therefore lynx and its relatives can do nothing meaningful. It would be nice to be able to grab the content in batch from the command line, e.g., to check for updates from a cron job. One example of such a page is the one for a musician I like: http://www.anaismitchell.com. Looking at the source shows only JS code, as far as my eyes can find. Firefox renders it just fine interactively, and if I do "save as" -> "text files", the result is perfectly decent. My goal is to do simply that from the command line. A more technical example is the ISO country code search page: https://www.iso.org/obp/ui/#search Pressing the search button there (with the empty string) brings up the country codes and other info, "save as" -> "text files" works fine, but view source and lynx can do nothing. Help? Thanks in advance ...

Additional System Details

Installed Plug-ins

  • The IcedTea-Web Plugin executes Java applets.
  • Shockwave Flash 25.0 r0
  • Shockwave Flash 24.0 r0
  • This plug-in detects the presence of iTunes when opening iTunes Store URLs in a web page with Firefox.

Application

  • User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46

More Information

cor-el
  • Top 10 Contributor
  • Moderator
17669 solutions 159837 answers

Helpful Reply

Maybe this extension can help.

Maybe this extension can help. *iMacros for Firefox: https://addons.mozilla.org/firefox/addon/imacros-for-firefox/

Question owner

thanks for the suggestion, but as far as I can see, it makes no provision for command-line operation. "the entire macro will run at the click of a button".

I don't want to click a button, I want to run "firefox http://whatever do-something-to-save-as-text" from the shell.
thanks for the suggestion, but as far as I can see, it makes no provision for command-line operation. "the entire macro will run at the click of a button". I don't want to click a button, I want to run "firefox http://whatever do-something-to-save-as-text" from the shell.
cor-el
  • Top 10 Contributor
  • Moderator
17669 solutions 159837 answers

Btw, this is my favorite Anais song (shenandoah)


I don't know if you can run a macro automatically on page load as I've never used this extension.

Btw, this is my favorite Anais song (shenandoah) *https://www.youtube.com/watch?v=7-jZmkenrpo *https://www.youtube.com/watch?v=gTmBufHhxOY): ---- I don't know if you can run a macro automatically on page load as I've never used this extension.

Helpful Reply

As far as I can see, imacros just does replays of actions, like keyboad macros in emacs.

searching around for page load, I couldn't find a way to automatically do a save-as after load. and i also still can't see any way to do anything from the command line.

thanks for trying ...

p.s. i like shenandoah a lot too : ). if i had to pick just one, i think it would be Coming Down, but I'm glad I don't have to pick : ).

As far as I can see, imacros just does replays of actions, like keyboad macros in emacs. searching around for page load, I couldn't find a way to automatically do a save-as after load. and i also still can't see any way to do anything from the command line. thanks for trying ... p.s. i like shenandoah a lot too : ). if i had to pick just one, i think it would be Coming Down, but I'm glad I don't have to pick : ).