XPath does not return the proper content


I’m trying to retrieve the content of cells in a HTML table. The page is the following:


I’m trying to retrieve the content of the cells under “Pictograms, Signal Word Code(s)” in the orange table using XPath. My XPath query looks like this:

//*/table[@class=“CLPtable taglib-search-iterator”]/descendant::td[contains(@class, ‘centerText cli-vertical-align-center’) and contains(text(), ‘GHS’)]

This query works as expected in the Elements Console in Chrome (proper content highlighted, but when I retrieve the page with the Palladian HTTPRetrieve / HTML Parser, followed by the XPath node, I get an empty Collection cell.

Other, similarly formatted queries retrieve the right content into a Collection cell.

Thank for your help


Can you post an example workflow?

– Philipp


Chrome add

Sure !
XPath_Example.knwf (254.1 KB)

Thanks, but the issue is, I need to match all cells under the Pictograms,… column, and depending on the page I call, this may be one cell, or 10, or whatever, so the query must be generic enough.

The approach is wrong, there are shortcomings.

@umutcankurt Thanks, but again, this is not the information I need. Both first queries (Test3 and Title) return the right information (as seen in your screenshot above). The query that does not return the proper information is the one called GHS. In Chrome, it identifies the proper content but in KNIME it returns an empty collection.



Hi @sparel,

@umutcankurt has provided the correct XPath in the previous post.

I suggest using Firefox to find XPaths.




@umutcankurt, Thanks! Seems to be doing what I was expecting, even if I don’t understand the full query.


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