如上图,我想获取选中部分的data-follow内的值,正则我已经写出来了,就是只能获取第一个,以下的都获取不到代码是这样的Regex r = new Regex(@"(?is)data-follow=""([^""]+)""");
foreach (HtmlElement he in myWeibo.Document.GetElementsByTagName("li"))
{
//Regex reg = new Regex(@"(?is)title=""([^""]+)"" href=""([^""]+)"""); if (he.GetAttribute("classname") == "clearfix")
{
Match mm = r.Match(he.InnerHtml);
MessageBox.Show(mm.Groups[1].Value);
}
}求高手解答,我想获取uid=后面的数字,和fnick=后面的名字,谢谢高手啦,在线等,急急急
MatchCollection mc = regex.Matches(myWeibo.Document.Body.InnerHtml);
foreach (Match item in mc)
{
//item.Value
}
if(he.GetAttribute("data-follow")!=string.Empty)
{
//字符串处理
}
这样不就行了
高手,这样的标签应该怎么获取
<li class=\"clearfix\" data-follow=\"uid=1821135665&fnick=梁博--\">
我发现没斜杠的可以获取,但是带斜杠的就获取不到了