Find tag with id including [] with Nokogiri

后端 未结 3 1075
时光说笑
时光说笑 2021-02-14 05:09

I have an html element like:

I want to search for this element by id, but it seems that nokogiri is getting confus

3条回答
  •  情话喂你
    2021-02-14 05:27

    The real problem here is that the characters [ and ] are illegal in an HTML4 (or XML) id attribute - look at the following:

    http://www.w3.org/TR/html401/types.html#type-name

    (for the normative definition of the id attribute look at www.w3.org//TR/html401/struct/global.html#adef-id)

提交回复
热议问题