zoukankan      html  css  js  c++  java
  • C# walls

    在学习C#的阶段中,我们一点一点的往前爬,

    此代码需要添加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();
            }
        }
    }
  • 相关阅读:
    魔兽争霸3 视野插件
    使用MS08-067 漏洞攻击xp靶机
    CentOS 7 安装Nginx
    给linux系统添加系统调用
    树莓派3b aarch64 cpu性能测试
    树莓派3b 安装arch linux 2
    树莓派3b 安装arch linux 1
    远程线程注入 CreateRemoteThread 返回NULL
    go mod 相关
    给 Windows 的终端配置代理
  • 原文地址:https://www.cnblogs.com/Tinamei/p/5167420.html
Copyright © 2011-2022 走看看