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.
Important
This tool is not intended to break copyright laws and is for personal use only. It merely automates the retrieval of publicly available data using standard web scraping techniques. The copyright of the data retrieved belongs to its respective owners, and I am not responsible for any illegal redistribution or misuse of data obtained using this tool.
Caution
Use of this tool is at your own risk. By using this tool, you agree that you are solely responsible for any legal issues that may arise from your use of this tool.
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