HTML extraction selector isn't working as expected

Describe the problem/error/question

When I try and use a CSS selector, I find that it works in the browser console, but not in n8n and I don’t understand why.

I reproduced this with a n8n website.

  1. Go to Insert Excel data to Postgres | n8n workflow template
  2. Open the console and run the following JS document.querySelectorAll('#__layout > div > section > div.webcomponent__monitor > n8n-demo');
  3. You will see that this returns the expected workflow element

When doing this in n8n, you can get as far as #__layout > div > section > div.webcomponent__monitor and see the n8n-demo element on the right side in the Output. But the moment you ask for the n8n-demo object it returns nothing.

What is the error message (if any)?

No error message.

Please share your workflow

Information on your n8n setup

  • n8n version: 1.1.1
  • Database SQLite
  • n8n EXECUTIONS_PROCESS setting default:
  • Running n8n via Docker:
  • Operating system: Ubuntu

Hi @Boris_Abrega :wave: I just confirmed this behaviour on 1.1.1 - I’m not sure what’s expected here, so I’ll create a ticket for our engineers to look into this. :bowing_man: I’ll be back as soon as I have an update!

I also tried doing parsing using techniques of creating a dummy element using document.createElement or a DomParser but neither seems to be available within the script node context.

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