# NuGet package - Selenium WebDriver ChromeDriver
[![NuGet Package](https://img.shields.io/badge/nuget-for%20Chrome%20v113-blue.svg)](https://www.nuget.org/packages/Selenium.WebDriver.ChromeDriver/113.0.5672.6300) [![NuGet Package](https://img.shields.io/badge/nuget-for%20Chrome%20v114-blue.svg)](https://www.nuget.org/packages/Selenium.WebDriver.ChromeDriver/114.0.5735.9000) [![NuGet Package](https://img.shields.io/badge/nuget-for%20Chrome%20v115-blue.svg)](https://www.nuget.org/packages/Selenium.WebDriver.ChromeDriver/115.0.5790.17000)
## What's this?
This NuGet package installs Chrome Driver (Win32, macOS, macOS arm64, and Linux64) for Selenium WebDriver into your Unit Test Project.
"chromedriver(.exe)" does not appear in Solution Explorer, but it is copied to the output folder from the package source folder when the build process.
NuGet package restoring ready, and no need to commit "chromedriver(.exe)" binary into source code control repository.
> **Warning**
> Since Selenium WebDriver version 4.6 was released in November 2022 or later, it has contained ["Selenium Manager"](https://www.selenium.dev/blog/2022/introducing-selenium-manager/), which will automatically download the most suitable version and platform WebDriver executable file. So now, **you can run applications that use Selenium and manipulates web browsers without this package.** However, due to compatibility and some offline scenarios, we intend to keep this package for the time being.
## How to install?
For example, at the package manager console on Visual Studio, enter the following command.
If you are using Chrome version 115:
PM> Install-Package Selenium.WebDriver.ChromeDriver -Version 115.0.5790.17000
If you are using Chrome version 114:
PM> Install-Package Selenium.WebDriver.ChromeDriver -Version 114.0.5735.9000
If you are using Chrome version 113:
PM> Install-Package Selenium.WebDriver.ChromeDriver -Version 113.0.5672.6300
To learn what version of ChromeDriver you need to use, please see also the following page:
[https://chromedriver.chromium.org/downloads/version-selection](https://chromedriver.chromium.org/downloads/version-selection)
## Cross-platform building and publishing
### By default - it depends on the OS running the build process
By default, the platform type of the web driver file copied to the output folder depends on the OS running the build process.
- When you build the project which references the NuGet package of chromedriver **on Windows OS**, **win32 version** of chromedriver will be copied to the output folder.
- When you build it **on macOS on Intel CPU hardware**, **macOS x64 version** of chromedriver will be copied to the output folder.
- When you build it **on macOS on Apple CPU hardware**, **macOS Arm64 version** of chromedriver will be copied to the output folder.
- When you build it on **any Linux distributions**, **Linux x64 version** of chromedriver will be copied to the output folder.
### Method 1 - Specify "Runtime Identifier"
When you specify the "Runtime Identifier (**RID**)" explicitly, the platform type of the driver file is the same to the RID which you specified. (it doesn't depends on the which OS to use for build process.)
You can specify RID as a MSBuild property in a project file,
```xml
<PropertyGroup>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>
```
or, as a command-line `-r` option for dotnet build command.
```shell
> dotnet build -r:osx.10.12-x64
```
- When the RID that **starts with "win"** is specified, **win32 version** of chromedriver will be copied to the output folder.
- When the RID that **starts with "osx"** and **ends with "x64"** is specified, **macOS x64 version** of chromedriver will be copied to the output folder.
- When the RID that **starts with "osx"** and **ends with "arm64"** is specified, **macOS Arm64 version** of chromedriver will be copied to the output folder.
- When the RID that **starts with "linux"** is specified, **Linux x64 version** of chromedriver will be copied to the output folder.
If you specify another pattern of RID like "ubuntu.18.04-x64", the platform type of the web driver file which will be copied to the output folder depends on the OS running the build process. (default behavior.)
### Method 2 - Specify "WebDriverPlatform" msbuild property
You can control which platform version of chromedriver will be copied by specifying "WebDriverPlatform" MSBuild property.
"WebDriverPlatform" MSBuild property can take one of the following values:
- "win32"
- "mac64"
- "mac64arm"
- "linux64"
You can specify "WebDriverPlatform" MSBuild property in a project file,
```xml
<PropertyGroup>
<WebDriverPlatform>win32</WebDriverPlatform>
</PropertyGroup>
```
or, command-line `-p` option for dotnet build command.
```shell
> dotnet build -p:WebDriverPlatform=mac64
```
The specifying "WebDriverPlatform" MSBuild property is the highest priority method to control which platform version of the chromedriver will be copied.
If you run the following command on Windows OS,
```shell
> dotnet build -r:ubuntu.18.04-x64 -p:WebDriverPlatform=mac64
```
The driver file of macOS x64 version will be copied to the output folder.
## How to include the driver file into published files?
"chromedriver(.exe)" isn't included in published files on default configuration. This behavior is by design.
If you want to include "chromedriver(.exe)" into published files, please define `_PUBLISH_CHROMEDRIVER` compilation symbol.
![define _PUBLISH_CHROMEDRIVER compilation symbol](https://raw.githubusercontent.com/jsakamoto/nupkg-selenium-webdriver-chromedriver/master/.asset/define_PUBLISH_CHROMEDRIVER_compilation_symbol.png)
Another way, you can define `PublishChromeDriver` property with value is "true" in MSBuild file (.csproj, .vbproj, etc...) to publish the driver file instead of define compilation symbol.
```xml
<Project ...>
...
<PropertyGroup>
...
<PublishChromeDriver>true</PublishChromeDriver>
...
</PropertyGroup>
...
</Project>
```
You can also define `PublishChromeDriver` property from the command line `-p` option for `dotnet publish` command.
```shell
> dotnet publish -p:PublishChromeDriver=true
```
#### Note
`PublishChromeDriver` MSBuild property always override the condition of define `_PUBLISH_CHROMEDRIVER` compilation symbol or not. If you define `PublishChromeDriver` MSBuild property with false, then the driver file isn't included in publish files whenever define `_PUBLISH_CHROMEDRIVER` compilation symbol or not.
## Appendix
### The numbering of the package version
The rule of the version number of this package is:
`chromedriver version MAJOR.MINOR.BUILD.PATCH` + `package version (2 digit)`
For example, 2nd package release for the chromedriver ver.1.2.3.4, the package version is `1.2.3.4` + `02` → `1.2.3.402`.
Sometime multiple packages for the same chromedriver version may be released by following example reasons.
- Packaging miss. (the package included invalid version of the driver files)
- Fixing bug of the build script, or improving the build script.
### Where is chromedriver.exe saved to?
chromedriver(.exe) exists at
" _{solution folder}_ /packages/Selenium.WebDriver.ChromeDriver. _{ver}_ /**driver**/ _{platform}_"
folder.
{Solution folder}/
+-- packages/
| +-- Selenium.WebDriver.ChromeDriver.{version}/
| +-- driver/
| | +-- win32
| | +-- chromedriver.exe
| | +-- mac64
| | +-- chromedriver
| | +-- mac64arm
| | +-- chromedriver
| | +-- linux64
| | +-- chromedriver
| +-- build/
+-- {project folder}/
+-- bin/
+-- Debug/
| +-- chromedriver(.exe) (copy from above by build process)
+-- Release/
+-- chromedriver(.exe) (copy from above by build process)
And packag
没有合适的资源?快使用搜索试试~ 我知道了~
C# 实现的爬虫方式Charp
共135个文件
dll:41个
xml:15个
pdb:14个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 166 浏览量
2024-02-02
17:25:14
上传
评论
收藏 189.36MB ZIP 举报
温馨提示
C#实现的爬虫方式
资源推荐
资源详情
资源评论
收起资源包目录
C# 实现的爬虫方式Charp (135个子文件)
ConsoleApp1.csproj.AssemblyReference.cache 9KB
DesignTimeResolveAssemblyReferencesInput.cache 7KB
ConsoleApp1.csproj.CoreCompileInputs.cache 41B
ConsoleApp1.csproj.SuggestedBindingRedirects.cache 0B
chromedriver 16.31MB
chromedriver 14.94MB
chromedriver 12.92MB
LICENSE.chromedriver 273KB
LICENSE.chromedriver 234KB
LICENSE.chromedriver 234KB
LICENSE.chromedriver 193KB
packages.config 653B
App.config 184B
ConsoleApp1.exe.config 184B
ConsoleApp1.csproj.CopyComplete 0B
Program.cs 4KB
AssemblyInfo.cs 1KB
.NETFramework,Version=v4.7.2.AssemblyAttributes.cs 210B
ConsoleApp1.csproj 5KB
WebDriver.dll 8.79MB
WebDriver.dll 8.79MB
WebDriver.dll 8.79MB
WebDriver.dll 8.79MB
WebDriver.dll 8.79MB
WebDriver.dll 6.18MB
WebDriver.dll 6.18MB
WebDriver.dll 6.15MB
WebDriver.dll 6.15MB
HtmlAgilityPack.dll 166KB
HtmlAgilityPack.dll 166KB
HtmlAgilityPack.dll 161KB
HtmlAgilityPack.dll 161KB
HtmlAgilityPack.dll 161KB
HtmlAgilityPack.dll 159KB
HtmlAgilityPack.dll 156KB
HtmlAgilityPack.dll 147KB
HtmlAgilityPack.dll 147KB
HtmlAgilityPack.dll 129KB
HtmlAgilityPack.dll 129KB
HtmlAgilityPack.dll 129KB
Colorful.Console.dll 89KB
Colorful.Console.dll 89KB
Colorful.Console.dll 89KB
Colorful.Console.dll 89KB
Colorful.Console.dll 88KB
Colorful.Console.dll 88KB
Colorful.Console.dll 88KB
Colorful.Console.dll 85KB
WebDriver.Support.dll 37KB
WebDriver.Support.dll 37KB
WebDriver.Support.dll 37KB
WebDriver.Support.dll 37KB
WebDriver.Support.dll 37KB
WebDriver.Support.dll 37KB
WebDriver.Support.dll 37KB
WebDriver.Support.dll 37KB
WebDriver.Support.dll 37KB
ThoughtWorks.Selenium.Core.dll 29KB
ThoughtWorks.Selenium.Core.dll 29KB
ThoughtWorks.Selenium.Core.dll 29KB
msedgedriver.exe 15.92MB
msedgedriver.exe 12.9MB
msedgedriver.exe 12.9MB
chromedriver.exe 11.74MB
chromedriver.exe 11.74MB
selenium-manager.exe 3.34MB
selenium-manager.exe 3.34MB
ConsoleApp1.exe 7KB
ConsoleApp1.exe 7KB
HtmlAgilityPack.deps.json 59KB
HtmlAgilityPack.deps.json 46KB
HtmlAgilityPack.deps.json 1KB
README.md 8KB
msedgedriver 18.91MB
msedgedriver 15.27MB
Selenium.WebDriver.MSEdgeDriver.114.0.1823.58.nupkg 31.39MB
Selenium.WebDriver.ChromeDriver.115.0.5790.17000.nupkg 28.48MB
Selenium.WebDriver.4.11.0.nupkg 22.69MB
HtmlAgilityPack.1.11.51.nupkg 1.43MB
Colorful.Console.1.2.15.nupkg 231KB
Selenium.Support.4.11.0.nupkg 136KB
Selenium.RC.3.1.0.nupkg 99KB
.signature.p7s 11KB
.signature.p7s 11KB
.signature.p7s 11KB
.signature.p7s 11KB
.signature.p7s 11KB
.signature.p7s 9KB
.signature.p7s 9KB
HtmlAgilityPack.pdb 370KB
HtmlAgilityPack.pdb 316KB
HtmlAgilityPack.pdb 316KB
HtmlAgilityPack.pdb 308KB
HtmlAgilityPack.pdb 308KB
HtmlAgilityPack.pdb 278KB
HtmlAgilityPack.pdb 222KB
HtmlAgilityPack.pdb 222KB
HtmlAgilityPack.pdb 222KB
HtmlAgilityPack.pdb 54KB
HtmlAgilityPack.pdb 49KB
共 135 条
- 1
- 2
资源评论
薪薪代码
- 粉丝: 2w+
- 资源: 265
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- ASCII American Standard Code for Information Interchange
- 一个chm格式的 SQL 函数手册-SQL语言手册文档
- 计算当前月份的天数和剩余天数
- 基于ARM的指令调度和延迟分支
- 基于Vue和TypeScript的极简聊天应用设计源码 - HasChat
- 基于Vue2全家桶和Zcool数据的图片收集网站设计源码 - cool-picture
- 基于C和C++的二维绘制工具设计源码 - DrawPro
- Object.defineProperty 的 IE 补丁object-defineproperty-ie-master.zip
- 整卷预览.mhtml
- MySQL是一种广泛使用的开源关系型数据库管理系统,它提供了丰富的SQL语句用于数据库的创建、查询、更新和管理 以下是一些常见的
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功