逍遥求救啊!!!急!!!!

lhr8577 2010-11-10 05:14:34
http://www.100to.com/item.htm?id=2532774801
提取这个页面的<strong id="J_StrPrice">58.00</strong>元
中的价格:58.00
...全文
106 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
lhr8577 2010-11-10
  • 打赏
  • 举报
回复
谢谢2位如此关注!!!
兔子-顾问 2010-11-10
  • 打赏
  • 举报
回复
正则表达式,
完整写法就是这样

string html = Encoding.GetEncoding("GBK").GetString(new System.Net.WebClient().DownloadData("http://www.100to.com/item.htm?id=2532774801"));
string result = System.Text.RegularExpressions.Regex.Match(html, @"(?<=<strong id=""J_StrPrice"">)\d+(\.\d+)?").Value;
wuhuabucai 2010-11-10
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 wuyazhe 的回复:]
try

C# code
string result = Regex.Match(yourHtml,@"(?<=<strong id=""J_StrPrice"">)\d+(\.\d+)?").Value;
[/Quote]
Y!
lhr8577 2010-11-10
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 wuyazhe 的回复:]
try

C# code
string result = Regex.Match(yourHtml,@"(?<=<strong id=""J_StrPrice"">)\d+(\.\d+)?").Value;
[/Quote]
Regex这是?
兔子-顾问 2010-11-10
  • 打赏
  • 举报
回复
try
string result = Regex.Match(yourHtml,@"(?<=<strong id=""J_StrPrice"">)\d+(\.\d+)?").Value;

111,129

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧