开发者

HtmlAgilityPack selecting nodes with end different

开发者 https://www.devze.com 2023-02-11 18:46 出处:网络
I\'ve this code... <td class=\"alt1\" id=\"td_threadtitle_335784\"> <td class=\"alt1\" id=\"td_threadtitle_342222\">

I've this code...

<td class="alt1" id="td_threadtitle_335784">
<td class="alt1" id="td_threadtitle_342222">
<td class="alt1" id="td_threadtitle_554213">
<td class="alt1" id="td_threadtitle_31226">
<td class="alt1" id="td_threadtitle_9442">

The question is...

How can i use the selectnodes or other function to select the ID's...

I try -

foreach (HtmlNode n in doc.DocumentNode.SelectNodes("//a[@id='td_threadtitle_']"))

B开发者_开发知识库ut the numbers in the end are $%@# Everthing...

[]'s


[SOLVED] I want to select only td_threadtitle_

Then i use This...

  `("//a[starts-with(@id,'thread_title_')]")`

Works Great!

This code i see here too..

Thanks for the

0

精彩评论

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