Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Almost as old as the Internet itself, the Lynx program was created in 1992 by students at the University of Kansas as a text-based browser. Because it's text-based, the Lynx program allows you to browse Websites directly from a terminal session, replacing the fancy graphics on Web pages with HTML text tags. This allows you to surf the Internet from just about any type of Linux terminal. A sample Lynx screen is shown in Figure 24.1.
Figure 24.1 Viewing a Web page using Lynx
Lynx uses the standard keyboard keys to navigate around the Web page. Links appear as highlighted text within the Web page. Using the right arrow key allows you to follow a link to the next Web page.
You may be wondering how you can use a graphical text program in your shell scripts. The Lynx program also provides a feature that allows you to dump the text contents of a Web page to STDOUT. This feature is great for mining for data contained within a Web page. This section describes how to use the Lynx program within your shell scripts to extract data from Internet Websites.