惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
Martin Fowler
Martin Fowler
D
Docker
F
Full Disclosure
Recent Announcements
Recent Announcements
MyScale Blog
MyScale Blog
美团技术团队
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog
A
About on SuperTechFans
IT之家
IT之家
P
Proofpoint News Feed
有赞技术团队
有赞技术团队
V
V2EX
阮一峰的网络日志
阮一峰的网络日志
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
雷峰网
雷峰网
WordPress大学
WordPress大学
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 【当耐特】
V
Visual Studio Blog
Hugging Face - Blog
Hugging Face - Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
Microsoft Security Blog
Microsoft Security Blog
U
Unit 42
腾讯CDC
Stack Overflow Blog
Stack Overflow Blog
B
Blog RSS Feed
I
InfoQ
N
Netflix TechBlog - Medium
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Vercel News
Vercel News
月光博客
月光博客
F
Fortinet All Blogs
Google DeepMind News
Google DeepMind News
小众软件
小众软件
Recorded Future
Recorded Future
博客园 - Franky
Blog — PlanetScale
Blog — PlanetScale
云风的 BLOG
云风的 BLOG
C
Check Point Blog
博客园 - 叶小钗
GbyAI
GbyAI
M
MIT News - Artificial intelligence
博客园 - 司徒正美

博客园 - 疯子峰

oracle性能分析2 oracle性能分析 诡异的socket连接失败 ELK配置watcher 多进程 vs 多线程 关于时间 ELK日志平台 Java web项目 wordpress之客户端发布文章 神舟笔记本安装ubuntu 10.10 安装vs2010 AOP, Aspect-oriented programming SPQuery查询语法简要说明(转) - 疯子峰 - 博客园 SPEmailEventReceiver 之导入附件EXCEL 为incoming mail绑定事件,SPEmailEventReceiver 安装Windows 2003更新后导致moss 无法访问 - 疯子峰 Ubuntu 的启动过程概览 linux 全局配置文件 vim 用户配置
获取淘宝商品描述和价格 - 疯子峰 - 博客园
疯子峰 · 2010-12-15 · via 博客园 - 疯子峰

1)价格

(?<=<strong\\s+[^>]*\"J_StrPrice\"\\s+>)(?<1>[^<]*)(?=</strong>) 

2)描述 

分为2步,先获取描述地址,后获取地址内容。 

(?<=')(?<1>http://dsc.taobaocdn.com.*)(?=')

取得地址后url 后,请求 http://dsc.taobaocdn.com/url

(?<=desc=')(?<1>.*)(?=';) 

 代码

 1             Regex reg = new Regex(regExpGoodsDescString);
 2             string tbdescUrl = GetMatchString(reg);
 3             HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(tbdescUrl);
 4             
 5             HttpWebResponse req = (HttpWebResponse)request.GetResponse();
 6             Stream stream = req.GetResponseStream();
 7             StreamReader sr = new StreamReader(stream, Encoding.Default);
 8             string desc = sr.ReadToEnd();
 9 
10             reg = new Regex("(?<=desc=')(?<1>.*)(?=';)", RegexOptions.Singleline | RegexOptions.Compiled);
11             return GetMatchString(reg, desc);