Lynx Command Line Browser
Lynx is a classic, non-graphical (CLI) web browser that allows you to navigate the internet directly from your terminal. It's incredibly useful for scripting, automation, and accessing web content on systems without a graphical interface. Below are some common usage examples for the Lynx browser.
Dump URL Content to Text
This command dumps the content of a given URL to standard output as plain text, without displaying the link URLs. This is useful for extracting text content from web pages.
# Dump [URL]; do not show link URLs.
lynx -dump -nolist [URL]
Create and Use Keystroke Files
Lynx allows you to record your keystrokes for automating repetitive web browsing tasks. You can then use these recorded keystroke files to execute a sequence of actions automatically.
# Creating your keystroke file for use with lynx(1).
lynx -cmd_log [FILE]
# Use above keystroke file to run repeating website actions.
lynx -accept_all_cookies -cmd_script=[FILE]
Convert HTML from STDIN to Text
This command converts HTML content piped from standard input into plain text and outputs it to standard output. This is a powerful way to process HTML content programmatically.
# Convert HTML from STDIN to text, then dump it to STDOUT.
lynx -force_html -stdin -dump -nolist