How to convert Xpath to CSS

后端 未结 4 389
长发绾君心
长发绾君心 2020-12-17 03:33

My xpath is: /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

4条回答
  •  不知归路
    2020-12-17 04:13

    Are you looking for something like this:

    http://jsfiddle.net/YZu8D/

    .tablecont tr:nth-child(2) td:nth-child(4) {background-color: yellow; }
    .tablecont tr:nth-child(3) td:nth-child(4) {background-color: yellow; }
    

提交回复
热议问题