<li>
<div class="info">
<a class="title_n" href="http://www.tootoomart.com/product-4134493-Men+the+new+Pure+paul+Sminth+Smith+sweater+16+colors+sweaters/" target="_blank"><h2>Men the new Pure paul Sminth Smith sweater 16 colors...</h2></a>
<p class="info">Men the new Pure paul Sminth Smith sweater 16 colors sweaters</p>
<div class="infoBox wrapClear">
<div class="supplier">Wholesaler: <a href="/seller-jingjinghaoyun888/">jingjinghaoyun888</a> <b class="star6"><img src="http://img.ttmimg.com/www/img/090514/transparent-pixel.gif" width="16" height="16" title="Feedback Score is 1-50"/></b></div>
<span id="isSellerOnline_jingjinghaoyun888_1"></span>
</div>
</div>
<div class="priceArea">
<p class="price1" id="price">$16.36~$16.58/Piece</p>
<div class="items">
<p class="price2">$163.59~$165.73/Lot</p>
<p class="priceInfo">(10 s per lot)</p>
</div>
</div>
<p class="images"><a href="http://www.tootoomart.com/product-4134493-Men+the+new+Pure+paul+Sminth+Smith+sweater+16+colors+sweaters/" title="Men the new Pure paul Sminth Smith sweater 16 colors sweaters" alt="Men the new Pure paul Sminth Smith sweater 16 colors sweaters" target="_blank"><img src="http://img.ttmimg.com/images/product/images/091219/90/0912190632381314441bmzaz_130.jpg" alt="Men the new Pure paul Sminth Smith sweater 16 colors sweaters" onload="if((this.width>=this.height)&&(this.width>=130)) {this.resized=true; this.width=130;} if((this.height>this.width)&&(this.height>=130)) {this.resized=true; this.height=130;}" onerror='this.onerror="";this.src="/images/www/nophoto_small.gif"' ptype="photo"/></a></p>
</li>我要匹配这里面所有P标签里的字 除(10 s per lot) 和$163.59~$165.73/Lot外 和图片的src 求匹配的正则
<div class="info">
<a class="title_n" href="http://www.tootoomart.com/product-4134493-Men+the+new+Pure+paul+Sminth+Smith+sweater+16+colors+sweaters/" target="_blank"><h2>Men the new Pure paul Sminth Smith sweater 16 colors...</h2></a>
<p class="info">Men the new Pure paul Sminth Smith sweater 16 colors sweaters</p>
<div class="infoBox wrapClear">
<div class="supplier">Wholesaler: <a href="/seller-jingjinghaoyun888/">jingjinghaoyun888</a> <b class="star6"><img src="http://img.ttmimg.com/www/img/090514/transparent-pixel.gif" width="16" height="16" title="Feedback Score is 1-50"/></b></div>
<span id="isSellerOnline_jingjinghaoyun888_1"></span>
</div>
</div>
<div class="priceArea">
<p class="price1" id="price">$16.36~$16.58/Piece</p>
<div class="items">
<p class="price2">$163.59~$165.73/Lot</p>
<p class="priceInfo">(10 s per lot)</p>
</div>
</div>
<p class="images"><a href="http://www.tootoomart.com/product-4134493-Men+the+new+Pure+paul+Sminth+Smith+sweater+16+colors+sweaters/" title="Men the new Pure paul Sminth Smith sweater 16 colors sweaters" alt="Men the new Pure paul Sminth Smith sweater 16 colors sweaters" target="_blank"><img src="http://img.ttmimg.com/images/product/images/091219/90/0912190632381314441bmzaz_130.jpg" alt="Men the new Pure paul Sminth Smith sweater 16 colors sweaters" onload="if((this.width>=this.height)&&(this.width>=130)) {this.resized=true; this.width=130;} if((this.height>this.width)&&(this.height>=130)) {this.resized=true; this.height=130;}" onerror='this.onerror="";this.src="/images/www/nophoto_small.gif"' ptype="photo"/></a></p>
</li>我要匹配这里面所有P标签里的字 除(10 s per lot) 和$163.59~$165.73/Lot外 和图片的src 求匹配的正则
解决方案 »
- 如何在cmd框中实现上下键回溯历史记录
- 求WPF资料,觉得不错的朋友一起拿来共享啊
- .net写的程序在没有.net framework的机子上点击运行后会自动提示要下载相应的.net framework吗?
- office的加粗、斜体按钮怎么实现
- winform里怎么从窗体1传值给窗体2里的textbox并显示出来?
- 求正则表达式
- combobox的怪问题,兄弟们见过没???
- 求C#写的调用WaveIn-Out的API函数的类,我主要用来录音,在线等待
- 求用C# 窗体控制程序 写出的发邮件的代码
- 如何过滤掉Image对象的某种颜色,从而获取Image的Region?
- 【菜鸟提问】大家看看这个软件界面如何设计的???
- c#怎么向数据库中为image类型保存空值?
<li[^>]*>.*?<h2>(?<name1>(?!</h2>).*)</h2>.*?<p(?!class).*class=['"]info['"]>(?<name2>.*?)</p>.*?<div\s*class=['"]supplier['"]>.*?<a[^>]*>(?<name3>.*?)</a>.*?<p\s*class=['"]price1['"]\s*id=['"]price['"]>(?<name4>.*?)</p>.*?<p\s*class=['"]images['"]>.*?<img\s*src=['"](?<name5>.*?)['"].*?</li>
string charset = "utf-8";
string html = GetHtmlSource(url, charset);
string reg =@"(?s)<li[^>]*>.*?<h2>(?<name1>(?!</h2>).*)</h2>.*?<p(?!class).*class=[""]info[""]>(?<name2>.*?)</p>.*?<div\s*class=[""]supplier[""]>.*?<a[^>]*>(?<name3>.*?)</a>.*?<p\s*class=[""]price1[""]\s*id=[""]price[""]>(?<name4>.*?)</p>.*?<p\s*class=[""]images[""]>.*?<img\s*src=[""](?<name5>.*?)[""].*?</li>";
Regex regex = new Regex(reg, RegexOptions.None);
MatchCollection matchCollection = regex.Matches(html);
for (int i = 0; i < matchCollection.Count; i++)
{
Match match = matchCollection[i];
string name = match.Groups["name1"].Value;
name = name.Replace("'", "''");
}这是代码name 里面取出来一大推HTML代码啊 不是我要的那一句啊 你们都测试时对的吗?求高手代码