# Extract data from html page and extract pre-structured JSON

**URL:** <https://discuss.huggingface.co/t/extract-data-from-html-page-and-extract-pre-structured-json/108160>\
**Category:** 🤗Transformers\
**Created:** [September 23, 2024, 3:15pm UTC](https://discuss.huggingface.co/t/extract-data-from-html-page-and-extract-pre-structured-json/108160 "2024-09-23T15:15:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![valerebron](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/valerebron/32/31954_2.png) [@valerebron](https://discuss.huggingface.co/u/valerebron)\
**Post date:** [September 23, 2024, 3:15pm UTC](https://discuss.huggingface.co/t/extract-data-from-html-page-and-extract-pre-structured-json/108160/1 "2024-09-23T15:15:32Z")

</div>

Hi hugging face community !  
I try to parse an html file and extract data to json.

For example, I want to crawll a web page listing events, such as this one “[La programmation | Bataclan - Bataclan](https://www.bataclan.fr/programmation/)”  
and search the html to find all gigs and generate a JSON structured like this:

```auto
{
 name: 'name of the event'
 date: 'a timestamp',
 url: 'url of event'
 artists: [
 {
   name: 'name of artist'
   style: 'style of artist'
   url: 'url of artist'
  }
]}

```

"  
I’d appreciate some expert advice. Is the Text2TextGeneration pipeline the best model for this type of task?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [September 23, 2024, 3:54pm UTC](https://discuss.huggingface.co/t/extract-data-from-html-page-and-extract-pre-structured-json/108160/2 "2024-09-23T15:54:52Z")

</div>

First off, let me say that LLM is not my area of expertise. Not even an expert in anything.  
The output from this space is markdown, but if you look at **app.py** , you’ll see that LLM is used. Other spaces, too, but it looks like something that could be diverted.

> **[Spaces - Hugging Face](https://huggingface.co/spaces?sort=trending&search=html)**
>
> Discover amazing ML apps made by the community

> **[HTML To Markdown - a Hugging Face Space by maxiw](https://huggingface.co/spaces/maxiw/HTML-to-Markdown)**
>
> Discover amazing ML apps made by the community
