HTML_Extract: How to do css selector to get Row1 & Highlighted Row X

Hey @getk, CSS selectors aren’t a concept specific to n8n, so you might want to take a look for example at W3Schools for more information on this:

A very simple approach of getting the right selector for a given value would be to open the HTML page in a browser, right click the value you’re interested in and select Inspect. Most browsers will then allow you to copy the CSS selector from the source code by right clicking it, like Firefox for example:

image

So a valid selector for “Medium” would be body > table:nth-child(2) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(2) > span:nth-child(1)

You can then use this selector in the HTML Extract node like so:

Hope this helps!

2 Likes