Script to parse divs from a html file and paste the results in a csv

Hello all,

I’m not familiarized with applescript and I have a task that would be sped up a great deal with some ( what I’m assuming is ) fairly simple scripting.

I have a bunch of html files on my local server. I need to generate a csv which will serve as base for a catalog to be phisically printed, containing info that are enclosed in the same divs for every page e.g. title, price, sku in each html page.

I researched this forum and haven’t found a complete solution. Also, with the bits and pieces I got from different answers, I couldn’t even figure out the proper syntax and it’s not a knowledge that would be useful enough for me to go deep into my learning.

What I need to do is:

Open html file from a folder->
parse source for text enclosed in an pre-defined set of divs →
paste the results on the corresponding cells on a csv file->close html file->
open the next file from the folder->parse source for text enclosed in an pre-defined set of divs ->paste the results on the line below on the csv file and so on.

I’d be truly grateful if someone could help with this, our at least point me in the right direction.