We can extract the parsed data to .csv or Excel format with the help of the pandas library.
Extracting data from HTML documents
Getting ready
To use the functions in the pandas module that export the parsed data to Excel, we require another dependent module openpyxl, so please make sure you install the openpyxl with pip:
pip install openpyxl
How to do it...
We can extract the data from HTML to .csv or Excel documents as following:
- To create a .csv file, we can use the to_csv() method in pandas. We can rewrite the previous recipe as follows:
import urllib.request import...