Seeking help about n8n learning basic details!

Describe the problem/error/question

Hey,everyone,all you awesome folks in the community forum! I’m from China and just started learning n8n. There’s one small thing I’ve been struggling with: how do you properly set up the ‘key’ and ‘CSS Selector’ in the ‘Extraction Values’ section of the HTML node? Thank you so much!!!

What is the error message (if any)?

Please share your workflow


Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @super_learner Welcome!
Please consider reading this:

In the HTML node’s Extraction Values, the Key is just the name you give to the extracted value in the output (e.g. “title”, “price”, “link”) - it becomes the field name in your JSON output. The CSS Selector is the actual selector targeting the element in the HTML, using standard CSS syntax like .title-link for a class, #main-heading for an ID, or h1 a for an anchor tag inside an h1.

From your screenshot, you have Key: title and CSS Selector: .title-link - that will extract the text content of any element with class title-link and output it as {{ $json.title }} in the next node. If you want the href attribute instead of the text, set Return Value to “Attribute” and enter href in the Attribute field.

Thank u so much!!!

@super_learner, please consider marking the most helpful answer to you as a solution that would help future wanderers to see what the exact answer to this problem is.