SelectNodes with XPath ignoring cases

前端 未结 1 1523
自闭症患者
自闭症患者 2020-12-03 21:55

I have a problem finding elements in XPath that\'s contains a certain string ignoring character casing.

I want to find in a HTML page all the nodes with id contains

相关标签:
1条回答
  • 2020-12-03 22:47

    Not sure if you've tried this yet, but this is what I do for case sensitive contains searches:

    //*[contains(translate(./@id,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'), 'footer')]/@id
    

    I saw you have found your solution, so I'm posting this answer in case others have the same issue.

    0 讨论(0)
提交回复
热议问题