bebook 发表于 2009-3-3 11:24:08

请教该种情况下如何设置结束字符串?

var desc='<span style="FONT-FAMILY: 宋体; LETTER-SPACING: 1pt; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: \'Times New Roman\';">这是内容内容内容内容</span>';

这里可以确认不变的就是以var desc='开头,以';结尾,但是现在内容里边也出现了'Times New Roman\';,结果在这个地方就停止了。请教如何设置可以采集全部内容?

xiongyujie37 发表于 2009-3-3 11:47:28

贴源码出来的啦

bebook 发表于 2009-3-3 12:06:00

源码:

var desc='<div align="center"><img alt="" src="http://tu.100xiu.net/daflogo.jpg" width="650" /></div><table align="center" border="0" cellpadding="0" cellspacing="0" width="610"><tr><td><p style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: 宋体; LETTER-SPACING: 1pt; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"><span style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; LETTER-SPACING: 1pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"><font color="#ff8080" size="3"><span style="FONT-FAMILY: 宋体; LETTER-SPACING: 3.4pt; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"><b>&nbsp;&nbsp;此款文胸有以下特点:<br />&nbsp;<br />1、无痕的设计点符合现代文胸的舒适主义观点。<font color="#ff8080" style="BACKGROUND-COLOR: #ffff80">还赠送隐形肩带一副哦~<br /></font><br /><br />2、立体的四分之三罩杯,定型海绵!无插片!<br /></b></span></font></span></span></p><p style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: 宋体; LETTER-SPACING: 1pt; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"><span style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; LETTER-SPACING: 1pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"><font color="#ff8080" size="3"><span style="FONT-FAMILY: 宋体; LETTER-SPACING: 3.4pt; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"><b>3、柔滑面料,贴身,轻柔。与胸部完美贴合,胸型饱满,圆润自然;精致的罩面,带来外观上的完美视觉享受。<br /></b></span></font></span></span></p><p style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: 宋体; LETTER-SPACING: 1pt; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"><span style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; LETTER-SPACING: 1pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"><font color="#ff8080" size="3"><span style="FONT-FAMILY: 宋体; LETTER-SPACING: 3.4pt; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"><b>4、吸汗,集中,强效聚拢胸部。挂脖的纤细肩带可以混搭更多种类的衣服。<br /></b></span></font></span></span></p><p style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: 宋体; LETTER-SPACING: 1pt; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"><span style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; LETTER-SPACING: 1pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"><font color="#8080c0" size="3"><span style="FONT-FAMILY: 宋体; LETTER-SPACING: 3.4pt; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"><b>本款文胸有黑色、白色、肤色、紫色、红色共五色,共有70、75、80三个码,每码均有A、B罩杯。</b></span></font></span></span></p><p style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: 宋体; LETTER-SPACING: 1pt; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"><span style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; LETTER-SPACING: 1pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"><font color="#282828" size="2"><span style="FONT-FAMILY: 宋体; LETTER-SPACING: 3.4pt; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"></span></font></span></span>&nbsp;</p><p style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: 宋体; LETTER-SPACING: 1pt; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"><span style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; LETTER-SPACING: 1pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"><font color="#282828" size="2"><span style="FONT-FAMILY: 宋体; LETTER-SPACING: 3.4pt; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"><b><font color="#8080ff"></font></b></span></font></span></span>&nbsp;</p><p style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: 宋体; LETTER-SPACING: 1pt; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"><span style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; LETTER-SPACING: 1pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"><font color="#8080ff" size="2"><span style="FONT-FAMILY: 宋体; LETTER-SPACING: 3.4pt; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"><b></b></span></font></span></span></p><p style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: 宋体; LETTER-SPACING: 1pt; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"><span style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; LETTER-SPACING: 1pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"><font color="#282828" size="2"><span style="FONT-FAMILY: 宋体; LETTER-SPACING: 3.4pt; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: \'Times New Roman\'; mso-hansi-font-family: \'Times New Roman\'"></span></font></span></span>&nbsp;</p></td></tr><tr><td><img alt="" src="http://tu.100xiu.net/dafchima.jpg" width="610" /></td></tr><tr><td><div align="center"><img alt="" src="http://tu.100xiu.net/daf/0811/WX051-5.jpg" /></div></td></tr><div align="center"><img alt="" src="http://tu.100xiu.net/daf/0811/WX051-4.jpg" /></div><div align="center"><img alt="" src="http://tu.100xiu.net/daf/0811/WX051-3.jpg" /></div><div align="center"><img alt="" src="http://tu.100xiu.net/daf/0811/WX051-2.jpg" /></div><div align="center"><img alt="" src="http://tu.100xiu.net/daf/0811/WX051-1.jpg" /></div><tr><td><div align="center"><img alt="" src="http://tu.100xiu.net/daf/0811/WX051-1_01.jpg" /></div></td></tr></table>';

我想采集整个内容,但是以';作为结束字符串的话就出提前停止

飛越無限 发表于 2009-3-3 13:36:16

在写规则的时候注意控制范围,可以多用(*)这类的来控制

xiongyujie37 发表于 2009-3-3 13:44:11

给网页地址吧 你截的也太乱了

bebook 发表于 2009-3-3 16:34:35

如果内容中间会出现....';...
结尾是';
怎么写结束字符串可以采集结尾之前的内容?
页: [1]
查看完整版本: 请教该种情况下如何设置结束字符串?