Simple Lightweight Web Scraping In Python

LZP Data Science
Geek Culture
Published in
5 min readNov 8, 2021

--

Sometimes limits imposed by an API would make it hard to extract content and data from a particular website. This is where the knowledge of web scraping comes in handy.

Web scraping helps by extracting the underlying HTML content of a particular website for various purposes. But, of course, there are also nefarious purposes to web scraping, such as the theft of copyrighted content, details of individuals etc., which we will not be diving into.

In python, there are a wide variety of packages or tools which one can use to build a decent web scraper. And in this post, we’ll just be trying out a python package I recently found and see how it performs.

This guide is just an example of how web scraping can be used for personal and non-commercial purposes. Kindly respect the scraping rules for various websites etc.

With that in mind, let’s try the autoscraper package out. The autoscraper package model learns a user-defined scraping rule and returns similar elements.

Installation

We’ll start by installing the package.

pip install autoscraper

Once installed, let’s find a webpage to test it out. Cryptocurrency has been pretty hot lately, so why don’t we try to extract the elements related to a particular…

--

--