易截截图软件、单文件、免安装、纯绿色、仅160KB

html unicode编码转换方法

对于"&# 24038;&# 36793;"这种&#开始的字符,应该为html unicode编码类型,解码方法如下:
s="&#  24038;& # 36793;"
s="左边"
import re
_=re.compile('&#(x)?([0-9a-fA-F]+);')
to_str=lambda s,charset='utf-8':_.sub(lambda result:unichr(int(result.group(2),result.group(1)=='x' and 16 or 10)).encode(charset) ,s)
print to_str(s)


相关文档:

HTML Table layout issue Draw a table

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test Page</title>
</head>
<body>
<table border="1px">
......

HTML特殊字符

双引号:&quot;或&#34;
单引号:&apos;或&#39;(IE实体名无效)
&符号:&amp;或&#38;
<小于:&lt;或&#60;
>大于:&gt;或&#62;
空格:&nbsp;或&#160;
£英磅:&pound;或&#163;
¥元:&yen;或&#165;
¦分隔符:&brvbar;或& ......

c#从html中获取图片地址

 
using System.Text.RegularExpressions;
string ohtml = this.TextBox1.Text;
            System.Text.RegularExpressions.MatchCollection m;
            //提取字符串的图片
   ......

刚刚找出来的相对准确的查找HTML的正则表达式

Dim objReg,objMatches,objMatch
Set objReg=new RegExp
objReg.Global=True
objReg.IgnoreCase=True
objReg.Pattern="<('[^']*'|""[^""]*""|[^'"">])*?>"
Set objMatches=objReg.Execute(字符串)
For Each objMatch In objMatches
找到的HTML :objMatch.value
Next
Set objMatches=Nothing
Set objRe ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号