- 
							
去除html标签
普通类 - 
							
- 支持
 - 批判
 - 提问
 - 解释
 - 补充
 - 删除
 
 - 
							
- 
													1、得到网页上的链接地址
 
string matchString = @"<a[^>]+href=\s*(?:'(?<href>[^']+)'|""(?<href>[^""]+)""|(?<href>[^>\s]+))\s*[^>]*>";
- 
													2、得到网页的标题
 
string matchString = @"<title>(?<title>.*)</title>";
- 
													3、去掉网页中的所有的html标记
 
- 
													4、其他一些方法
 
document方法:
getElementById(id) 返回指定结点的引用
getElementsByTagName(name) 返回文档中所有匹配的元素的集合
createElement(name) 创建指定类型的新结点
createTextNode(text) 创建一个纯文本结点element方法:
getAttribute(id) 返回指定属性的值
setAttribute(id,value) 给属性赋值
removeAttribute(id) 移除指定属性和它的值
getElementsByTagName(name) 返回结点内所有匹配的元素的集合node方法:
appendChild(child) 给指定结点添加一个新的子结点
removeChild(child) 移除指定结点的子结点
replaceChild(newChild,oldChild) 替换指定结点的子结点
insertBefore(newChild,refChild) 在同一层级的结点前面插入新结点
hasChildNodes() 如果结点有子结点则返回truenode属性:
nodeName 以字符串的格式存放结点的名称
nodeType 以整型数据格式存放结点的类型
nodeValue 以可用的格式存放结点的值
parentNode 指向结点的父结点的引用
childNodes 指向子结点的引用的集合
firstChild 指向子结点结合中的第一个子结点的引用
lastChild 指向子结点结合中的最后一个子结点的引用 - 
													
 - 
							
- 标签:
 - 结点
 - html
 - 标签
 - 指定
 
 - 
				
				
加入的知识群:
 
			
								
						
学习元评论 (0条)
聪明如你,不妨在这 发表你的看法与心得 ~