Convert a HTML Table into a CSV file using Python.
After installing python and pip, install the below modules in the terminal:
pip install beautifulsoup4
pip install pandas
Change your directory to the directory the python script is in and run main.py
:
cd python-convert_html_table_to_csv
python3 main.py
- The
.csv
file will output in the same folder as your script. You can modify the output.csv
file name or location by updating theoutput_path
variable inmain.py
. - Be sure sure to modify
main.py
by changing thepath
variable to the website URL or web page you're trying to parse the HTML from.
This project is released under the terms of The Unlicense, which allows you to use, modify, and distribute the code as you see fit.
- The Unlicense removes traditional copyright restrictions, giving you the freedom to use the code in any way you choose.
- For more details, see the LICENSE file in this repository.
Author: Scott Grivner
Email: scott.grivner@gmail.com
Website: scottgrivner.dev
Reference: Main Branch