C# extract multiples from web pages based on OpenQA.Selenium.Chrome and ChromeDriver
1.Install latest Chrome,Selenium.WebDriver, ChromeDriver
Selenium.WebDriver 3.141.0;
Selenium.WebDriver.ChromeDriver 78.0.3904.7000;
2.
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium;
using System.Reflection; static void WebDriverDemo(string url = "http://www.tieba.com/p/4325046994#!/l/p1")
{
ChromeDriver driver = new ChromeDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); driver.Navigate().GoToUrl(url);
List<IWebElement> lwe = driver.FindElements(By.CssSelector("img")).ToList(); List<string> imgsList = new List<string>();
StringBuilder imgBuilder = new StringBuilder();
foreach(var img in lwe)
{
string imgUrl = img.GetAttribute("src");
imgBuilder.AppendLine(imgUrl);
imgsList.Add(imgUrl);
} File.WriteAllText("lyf.txt", imgBuilder.ToString());
}
C# extract multiples from web pages based on OpenQA.Selenium.Chrome and ChromeDriver的更多相关文章
- Displaying Data in a Chart with ASP.NET Web Pages (Razor)
This article explains how to use a chart to display data in an ASP.NET Web Pages (Razor) website by ...
- Web Pages - Efficient Paging Without The WebGrid
Web Pages - Efficient Paging Without The WebGrid If you want to display your data over a number of p ...
- ASP.NET Web Pages (Razor) FAQ
ASP.NET Web Pages (Razor) FAQ By Tom FitzMacken|February 7, 2014 Print This article lists some fre ...
- 如何在ASP.NET Web站点中统一页面布局[Creating a Consistent Layout in ASP.NET Web Pages(Razor) Sites]
如何在ASP.NET Web站点中统一页面布局[Creating a Consistent Layout in ASP.NET Web Pages(Razor) Sites] 一.布局页面介绍[Abo ...
- Web Pages razor 学习
1. Web Pages razor Web Pages 是三种 ASP.NET 编程模型中的一种,用于创建 ASP.NET 网站和 web 应用程序. 其他两种编程模型是 Web Forms 和 M ...
- ASP.NET MVC3 系列教程 – Web Pages 1.0
http://www.cnblogs.com/highend/archive/2011/04/14/aspnet_mvc3_web_pages.html I:Web Pages 1.0中以“_”开头的 ...
- Web网页中动态数据区域的识别与抽取 Dynamical Data Regions Identification and Extraction in Web Pages
Web网页中动态数据区域的识别与抽取 Dynamical Data Regions Identification and Extraction in Web Pages Web网页中动态数据区域的识别 ...
- 五张图概括 什么是 ASP 、 ASP.NET (Web Pages,Web Forms ,MVC )
当你看懂下面这五张图,我相信你对于学习.NET Web开发路线将不陌生! 来源: http://www.w3 ...
- 安卓,网页控件,显示网页 Android, web controls, display web pages
安卓,网页控件,显示网页Android, web controls, display web pages 作者:韩梦飞沙 Author:han_meng_fei_sha 邮箱:313134555@qq ...
随机推荐
- [CodeForces - 1225D]Power Products 【数论】 【分解质因数】
[CodeForces - 1225D]Power Products [数论] [分解质因数] 标签:题解 codeforces题解 数论 题目描述 Time limit 2000 ms Memory ...
- 第11章 UDP:用户数据报协-----读书笔记
1.分片应用程序只关心IP数据报的长度,如果它超过MTU值,那么就要对数据包进行分片. 2.UDP首部字段图: (16位源端口号+16位目端口号+16位UDP长度+16位UDP校验和+数据) 3.UD ...
- Docker安装ELK
1.下载elk docker pull sebp/elk 2.启动elk //Elasticsearch至少需要单独2G的内存 //增加了一个volume绑定,以免重启container以后ES的数据 ...
- dataTable 表插入新行
DataRow dr = dt.NewRow();//定义新行 dr["sumPrice"] = sumPrice;//对应字段赋值 d ...
- 使用session存储,购物车结算add_to_order.php(学生笔记)
<?php session_start(); include_once("DB.class.php"); //接受并解析前端传过来的json,转换成数组. $goods_li ...
- MAC 软件提示已损坏,需要移到废纸篓的解决方法
解决方法一: 允许任何来源的应用.在系统偏好设置里,打开“安全性和隐私”,将“允许从以下位置下载的应用程序”设置为“任何来源“.当然,这个设置已经无法在Mac OS Sierra上完成了. 在Mac ...
- jenkins构建找不到python依赖
最近在搞jenkins自动构建,遇到这样一个问题,我装的python相关的依赖在X用户下,但是jenkins在root下运行的,所以找不到相关的import 1. 执行pip freeze,会打印相关 ...
- python while语句
一.while 1.while 死循环 f=True while f: print(1) print(2) 2.while 活循环 ①.正序 count = 1 while count <= 5 ...
- fastadmin安装定时插件报错 ZipArchive::extractTo(): Permission denied
环境linux上直接安装 如果你是在win开发号直接部署的应该是没问题 我是直接在linux安装的 这几天研了下fastadmin 想用他的定时可是在使用的时候报错 ZipArchive::e ...
- Attaching an entity of type 'xxx' failed because another entity of the same type already has the same primary key value.
问题的详细描述: Attaching an entity of type 'xxxxx' failed because another entity of the same type already ...