An open API service indexing awesome lists of open source software.

https://github.com/scottgriv/python-convert_html_table_to_csv

Scrape a web page table and convert it to a csv file.
https://github.com/scottgriv/python-convert_html_table_to_csv

converter csv csv-file csv-parser html html-table python utility utility-app utility-application utility-script

Last synced: 9 months ago
JSON representation

Scrape a web page table and convert it to a csv file.

Awesome Lists containing this project

README

          









Python Badge


GitHub Badge
Email Badge
BuyMeACoffee Badge


Bronze

---------------

Convert HTML Table into CSV

Convert a HTML Table into a CSV file using Python.

---------------

## Table of Contents

- [Getting Started](#getting-started)
- [Installation](#installation)
- [Usage](#usage)
- [Disclaimer](#disclaimer)
- [Resources](#resources)
- [License](#license)
- [Credits](#credits)

## Getting Started

### Installation

After installing python and pip, install the below modules in the terminal:
```shell
pip install beautifulsoup4
pip install pandas
```

Change your directory to the directory the python script is in and run ``main.py``:
```shell
cd python-convert_html_table_to_csv
python3 main.py
```

### Usage

- The `.csv` file will output in the same folder as your script. You can modify the output `.csv` file name or location by updating the ``output_path`` variable in ``main.py``.
- Be sure sure to modify ``main.py`` by changing the ``path`` variable to the website URL or web page you're trying to parse the HTML from.

## Disclaimer

> [!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.

## Resources

- [Python](https://www.python.org/)
- [Beautiful Soup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/)
- [Convert HTML Table into CSV file in Python](https://www.geeksforgeeks.org/convert-html-table-into-csv-file-in-python/)**
- [HTML Example Table](https://www.w3schools.com/html/html_tables.asp)**

## License

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](https://choosealicense.com/licenses/unlicense/) removes traditional copyright restrictions, giving you the freedom to use the code in any way you choose.
- For more details, see the [LICENSE](LICENSE) file in this repository.

## Credits

**Author:** [Scott Grivner](https://github.com/scottgriv)

**Email:** [scott.grivner@gmail.com](mailto:scott.grivner@gmail.com)

**Website:** [scottgrivner.dev](https://www.scottgrivner.dev)

**Reference:** [Main Branch](https://github.com/scottgriv/python-convert_html_table_to_csv)

---------------