Jumony.Core爬虫学习 [1]

来源:互联网 发布:彩虹跳转源码 编辑:程序博客网 时间:2024/06/01 07:54

Nuget 中下载 Jumony.Core 安装至当前项目



获取http://www.sonystyle.com.cn/mysony/acafe/index.htm 首页滚动图片URL

            foreach (var img in new JumonyParser().LoadDocument("http://www.sonystyle.com.cn/mysony/acafe/index.htm/",Encoding.GetEncoding(65001)).Find("[target=_blank]>img[src*=\"index\"]"))                textBox.Text = textBox .Text + "http://www.sonystyle.com.cn/mysony/acafe/" + img.Attribute("src").Value() +" \n";

PS. 注意head 中页面的编码信息注意转码

       相对路径和绝对路径的转化


CSS选择器 http://www.w3school.com.cn/cssref/css_selectors.asp

原创粉丝点击