Avatar
Fernando Vásquez is an electronics engineer and software developer currently based in the world. He occasionally blogs about Python and Android programming.

Why use w3m?

Why use w3m?

W3m is one of the few command line browsers, the other is Lynx.

Now that there is so much javascript functionality in web pages, it sounds a bit crazy to use a command line browser. However, there are some special cases where it might make sense. Here I show you some:

  1. The most obvious of all. You don’t have a graphical GUI and you only have terminal access to a computer. Need to quickly see a website or copy some content, with w3m you can see it instantly, without having to leave your terminal window.
  2. Need to know if they can see a website from a server that you only have access to through SSH.
  3. Need to see if any content is loading without javascript. Since W3m does not support Javascript, it is a way of knowing if a website loads well without Javascript.

Installing

  • Ubuntu
sudo apt update
sudo apt install w3m
  • CentOS
sudo yum -y install w3m

Usage

Execute with w3m or adding the URL you want to visit:

w3m -v https://google.com

While in w3m type shift + h for help, then /edit to search for edit, then n to find next occurrence of edit, you will soon find the answer you seek.

Type shift + b to go back to the page you were on.

Type o to get to the options window and change the default editor to vim.

  • Exit: q

Configuration

Config ~/.w3m/config

Headers

GET / HTTP/1.0
User-Agent: w3m/0.5.3
Accept: text/html, text/*;q=0.5, image/*
Accept-Encoding: gzip, compress, bzip, bzip2, deflate
Accept-Language: en;q=1.0
Host: localhost:9999
User-Agent: foo

all tags