How it works…

In the preceding script, we have written code to get contents from a website. The wget utility is used for retrieving files from the web using the http, https, and ftp protocols. In this example, we are getting data from imdb.com and therefore we specified the website name in wget. grep is a command-line utility used for searching data that will match a regular expression. Here, we are searching for the specific links, and those links will be saved in link_final.csv after the web scraping.

Get Bash Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.