Want to convert HTML Request into an Array

I simply want to convert this page into an array where every field of the 94 images are into different colums.

  • _parsed_params
  • textPrompt
  • seedImageURL
  • eventType
  • image_paths
  • prompt
  • ranking_score_average
  • type
  • full_command

Describe the issue/error/question

but I simply unable to get anything out of the single html block the HTML Request return.

What is the error message (if any)?

Please share the workflow

Information on your n8n setup

  • n8n version: 0.204.0
  • Database you’re using : PostgreSQL
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via : docker

Hi @JOduMonT, from taking a look at the website you have shared it seems it renders the content dynamically. Each of the items on the page appears to be wrapped in a <div> with role="gridcell":

Such divs do, however, not exist in the raw HTML n8n fetches. The relevant information does, however, appear to be in a <script> element with id="__NEXT_DATA__". So perhaps you want to try and consume this element instead? Here’s a quick example I’ve put together:

The code node only runs JSON.parse() against the aforementioned script element: JSON.parse() - JavaScript | MDN. The results seems to include the fields you’re looking for:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.