Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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: 20 days 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)
- [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.

## 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:** [[email protected]](mailto:[email protected])

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

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

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