{
 "name": "[노드 한 장] HTML · 책 20권, 제목·가격·별점만",
 "nodes": [
  {
   "id": "b1",
   "name": "Run manually",
   "type": "n8n-nodes-base.manualTrigger",
   "typeVersion": 1,
   "position": [
    0,
    0
   ],
   "parameters": {}
  },
  {
   "id": "b2",
   "name": "Get page (HTML)",
   "type": "n8n-nodes-base.httpRequest",
   "typeVersion": 4.2,
   "position": [
    240,
    0
   ],
   "parameters": {
    "url": "https://books.toscrape.com/",
    "options": {
     "response": {
      "response": {
       "responseFormat": "text",
       "outputPropertyName": "data"
      }
     }
    }
   }
  },
  {
   "id": "b3",
   "name": "Extract books",
   "type": "n8n-nodes-base.html",
   "typeVersion": 1.2,
   "position": [
    480,
    0
   ],
   "parameters": {
    "operation": "extractHtmlContent",
    "sourceData": "json",
    "dataPropertyName": "data",
    "extractionValues": {
     "values": [
      {
       "key": "title",
       "cssSelector": "article.product_pod h3 a",
       "returnValue": "attribute",
       "attribute": "title",
       "returnArray": true
      },
      {
       "key": "price",
       "cssSelector": "article.product_pod .price_color",
       "returnValue": "text",
       "returnArray": true
      },
      {
       "key": "rating",
       "cssSelector": "article.product_pod p.star-rating",
       "returnValue": "attribute",
       "attribute": "class",
       "returnArray": true
      }
     ]
    },
    "options": {
     "trimValues": true
    }
   }
  },
  {
   "id": "b4",
   "name": "One book per item",
   "type": "n8n-nodes-base.splitOut",
   "typeVersion": 1,
   "position": [
    720,
    0
   ],
   "parameters": {
    "fieldToSplitOut": "title, price, rating",
    "options": {}
   }
  },
  {
   "id": "b5",
   "name": "Clean up",
   "type": "n8n-nodes-base.set",
   "typeVersion": 3.4,
   "position": [
    960,
    0
   ],
   "parameters": {
    "assignments": {
     "assignments": [
      {
       "id": "c1",
       "name": "title",
       "type": "string",
       "value": "={{ $json.title }}"
      },
      {
       "id": "c2",
       "name": "price_gbp",
       "type": "number",
       "value": "={{ parseFloat($json.price.replace(/[^0-9.]/g,'')) }}"
      },
      {
       "id": "c3",
       "name": "stars",
       "type": "string",
       "value": "={{ $json.rating.replace('star-rating ','') }}"
      }
     ]
    },
    "options": {}
   }
  },
  {
   "id": "b6",
   "name": "Cheapest first",
   "type": "n8n-nodes-base.sort",
   "typeVersion": 1,
   "position": [
    1200,
    0
   ],
   "parameters": {
    "sortFieldsUi": {
     "sortField": [
      {
       "fieldName": "price_gbp",
       "order": "ascending"
      }
     ]
    },
    "options": {}
   }
  }
 ],
 "connections": {
  "Run manually": {
   "main": [
    [
     {
      "node": "Get page (HTML)",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Get page (HTML)": {
   "main": [
    [
     {
      "node": "Extract books",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Extract books": {
   "main": [
    [
     {
      "node": "One book per item",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "One book per item": {
   "main": [
    [
     {
      "node": "Clean up",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Clean up": {
   "main": [
    [
     {
      "node": "Cheapest first",
      "type": "main",
      "index": 0
     }
    ]
   ]
  }
 },
 "settings": {
  "timezone": "Asia/Seoul",
  "executionOrder": "v1"
 },
 "meta": {
  "templateCredsSetupCompleted": false,
  "source": "datapopcorn.ai/workflow/nodes"
 }
}