My xpath is: /html/body/div/table/tbody/tr[2]/td[4]
/html/body/div/table/tbody/tr[2]/td[4]
I need to get an CSS to use it in jsoup selector.
I found a comparison between xpath and css
Works good for me.
//Author: Oleksandr Knyga function xPathToCss(xpath) { return xpath .replace(/\[(\d+?)\]/g, function(s,m1){ return '['+(m1-1)+']'; }) .replace(/\/{2}/g, '') .replace(/\/+/g, ' > ') .replace(/@/g, '') .replace(/\[(\d+)\]/g, ':eq($1)') .replace(/^\s+/, ''); }