Python version 3.6
Install lxml. You can do this from the command line using pip with the following command. (Pip is Python’s package manager. If you don’t have it, be sure to get it, because it allows one-step installation of most packages.)
pip install lxml
In your Python code, import the html module, which parses HTML, from lxml.
from lxml import html
Requests: HTTP for Humans
Requests is the only Non-GMO HTTP library for Python, safe for human consumption.
import requests
cssselect library :
cssselect parses CSS3 Selectors and translates them to XPath 1.0
Install with pip install cssselect
Whole process can be done in two steps :
Part 1: Extracting the Data
Part 2: Writing the Data to a CSV