<td><a href="(?<Url>.{0,100})" target=_blank>
/// <summary> /// 正则表达式取值 /// </summary> /// <param name="HtmlCode">源码</param> /// <param name="RegexString">正则表达式</param> /// <param name="GroupKey">正则表达式分组关键字</param> /// <param name="RightToLeft">是否从右到左</param> /// <returns></returns> public static string[] GetRegValues(string HtmlCode, string RegexString, string GroupKey, bool RightToLeft) { MatchCollection m; Regex r; if (RightToLeft) { r = new Regex(RegexString, RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.RightToLeft); } else { r = new Regex(RegexString, RegexOptions.IgnoreCase | RegexOptions.Singleline); } m = r.Matches(HtmlCode); string[] MatchValue = new string[m.Count]; for (int i = 0; i < m.Count; i++) { MatchValue[i] = m[i].Groups[GroupKey].Value.Trim() ; } return MatchValue; }
上面这段代码即可完成,正则表达式为第一行的样子
服务端可以通过HtmlAgilityPack 来搞定
或者你可以通过jqueyr ajax的跨域访问,然后通过jquery的seletor来需要的信息