开发者

Selecting multible elements by ID (each one has unique ID)

开发者 https://www.devze.com 2023-04-03 00:05 出处:网络
I have multiple elements on page and all of them have unique id something like that: title_1, title_2, title_n etc.

I have multiple elements on page and all of them have unique id something like that: title_1, title_2, title_n etc.

<a href="http://link" id="title_1">Link name&l开发者_JAVA技巧t;/a>
<a href="http://link" id="title_2">Link name</a>
<a href="http://link" id="title_n">Link name</a>

Is this correct syntax for selecting these links?

a[id^=title]

IT seems to be not working.

Reference: http://jsoup.org/apidocs/org/jsoup/select/Selector.html


remove that dot

a[id^=title]
0

精彩评论

暂无评论...
验证码 换一张
取 消