手机
当前位置:查字典教程网 >网页设计 >脚本HTML教程 >从html代码中获取Img标签
从html代码中获取Img标签
摘要://////获取Img标签//////截获到的html代码///publicstaticListGetPadImg(stringhtmlTe...

  /// <summary>
/// 获取Img标签
/// </summary>
/// <param name="htmlText">截获到的html代码</param>
/// <returns></returns>
public static List<string> GetPadImg(string htmlText)
{
List<string> list = new List<string>();
Regex regImg = new Regex(@"<imgb[^<>]*?bsrc[strn]*=[strn]*[""']?[strn]*(?<imgUrl>[^strn""'<>]*)[^<>]*?/?[strn]*>", RegexOptions.IgnoreCase);
MatchCollection mc = regImg.Matches(htmlText);
foreach (Match m in mc)
{
list.Add(m.Groups["imgUrl"].Value); //获取Img标签
}
return list;
}

【从html代码中获取Img标签】相关文章:

HTML 4.0 语法影像标签

python轻松实现代码编码格式转换

html Meta标签小集

html中有亲和力的文字隐藏方法

html中设置让div中的内容超出后自动显示滚动条

为什么要使用html的meta标签?

Shell脚本中获取进程ID的方法

python获取标准北京时间的方法

为Html的Select加一个提示语和输入方法

div+css与xhtml+css是什么意思?

精品推荐
分类导航