0

I am building a website (HTML and CSS) to display and sell my art. At the bottom layer there will be multiple grandchildren, each page dedicated to a single work of art containing the item name, medium, description etc. I have written all the specific content I need for each grandchild in csv, see example below.

example of csv content.jpg

Rather than manually type out each html page for each artwork separately. I was wondering if there exist a method to automate this task (preferably using python)? I.e. wrapping specific tags around the content elements in the csv file. Essentially reverse engineering BeautifulSoup4 which converts HTML to csv.

thanks in advance...

Barmar
  • 741,623
  • 53
  • 500
  • 612
  • BS4 doesn't convert HTML to CSV. It just allows you to write programs that extract elements from HTML, you still have to write your own code that generates CSV from that. – Barmar Oct 26 '20 at 16:07
  • BeautifulSoup is parsing module. You're looking for templating library, for example [`jinja2`](https://pypi.org/project/Jinja2/) – Andrej Kesely Oct 26 '20 at 16:07
  • HTML tables are very simple. It shouldn't be hard for you to read a CSV file and turn each row into an HTML ``. – Barmar Oct 26 '20 at 16:08
  • 1
    @chin-rob You are using very confusing terminology here. Reverse engineering doesn't mean to build something that does the reverse of something else, it means to reconstruct its building blocks and understand how it works. So for example reverse engineering an oven wouldn't mean building a fridge, it would mean figuring out how the oven was built and reconstructing its blueprint. It's essentially reversing the process of engineering itself (from product to blueprint instead of going from blueprint to product), not engineering a product that works in reverse. – CherryDT Oct 26 '20 at 16:14

0 Answers0