C# walls
2016-01-28 20:32
309 查看
在学习C#的阶段中,我们一点一点的往前爬,
此代码需要添加selenium ,和 获取 引用。
此代码需要添加selenium ,和 获取 引用。
using Ivony.Html.Parser; using Ivony.Html; using OpenQA.Selenium; using OpenQA.Selenium.Firefox; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading; using System.Windows.Forms; namespace taobao { public partial class Form1 : Form { public Form1() { InitializeComponent(); } public static Thread th; private void button1_Click(object sender, EventArgs e) { th = new Thread(new ThreadStart(JDData)); th.Start(); } void JDData() { IWebDriver driver = new FirefoxDriver(); driver.Navigate().GoToUrl("http://list.jd.com/list.html?cat=9987%2C653%2C655&go=0"); //driver.FindElement(By.Id("startShopping")).Click(); //Thread.Sleep(5000); //IJavaScriptExecutor jse = (IJavaScriptExecutor)driver; //int height = 1000; //jse.ExecuteScript("document.documentElement.scrollTop=" + height); //Thread.Sleep(20000); string sc = driver.PageSource; //以上步骤是获取网页源码 //var documentsc = new Jumon var documenthtmlThree = new JumonyParser().Parse(sc); driver.Quit(); } } }
相关文章推荐
- c# Attribute
- C#遐想/瞎想
- C#正则获取字符串中的数字
- C#随机生成1到60不重复随机数
- C#中Override关键字和New关键字的用法详解
- C#委托
- 详解C#面相对象编程中的继承特性
- C# 装箱 拆箱 理解
- C# 异步
- C# 字体池技术实现
- C#中WinForm窗体的单例模式,避免窗体被实例化多次
- 深入解析C#编程中struct所定义的结构
- C# Socket SSL通讯笔记
- C# 初始winform——1
- 讲解C#面相对象编程中的类与对象的特性与概念
- c#动态类型Dynamic
- C#编程中使用ref和out关键字来传递数组对象的用法
- Web爬去的C#请求发送
- 深入解析C#中的交错数组与隐式类型的数组
- C#中用foreach语句遍历数组及将数组作为参数的用法